Skip to content

Commit

Permalink
Downgraded minSdk version, updated androidx-compose-ui-material3
Browse files Browse the repository at this point in the history
  • Loading branch information
KitsuneFolk authored and saket committed Sep 29, 2023
1 parent 20297e5 commit 191eb3e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[versions]
minSdk = "23"
minSdk = "21"
compileSdk = "34"
kotlin = "1.9.10"
agp = "8.1.0"
androidx-compose-ui = "1.5.1" # https://developer.android.com/jetpack/androidx/releases/compose-ui
androidx-compose-ui-material3 = "1.1.1"
androidx-compose-ui-material3 = "1.1.2"
androidx-compose-compiler = "1.5.3" # https://developer.android.com/jetpack/androidx/releases/compose-compiler
compose-multiplatform = "1.5.1" # https://github.com/JetBrains/compose-multiplatform/releases
androidx-appcompat = "1.6.1"
Expand Down
2 changes: 1 addition & 1 deletion sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ android {

defaultConfig {
applicationId = namespace
minSdk = 31
minSdk = libs.versions.minSdk.get().toInt()
compileSdk = libs.versions.compileSdk.get().toInt()
versionCode = 1
versionName = "1.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.saket.swipe.sample

import android.os.Build
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatActivity
Expand Down Expand Up @@ -42,6 +43,8 @@ import androidx.core.view.WindowCompat
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import me.saket.swipe.SwipeAction
import me.saket.swipe.SwipeableActionsBox
import me.saket.swipe.sample.theme.DarkTheme
import me.saket.swipe.sample.theme.LightTheme

@OptIn(ExperimentalMaterial3Api::class)
class SampleActivity : AppCompatActivity() {
Expand All @@ -57,7 +60,11 @@ class SampleActivity : AppCompatActivity() {
uiController.setNavigationBarColor(Color.Transparent)
}

val colors = if (systemInDarkTheme) dynamicDarkColorScheme(this) else dynamicLightColorScheme(this)
val colors = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
if (systemInDarkTheme) dynamicDarkColorScheme(this) else dynamicLightColorScheme(this)
} else {
if (systemInDarkTheme) DarkTheme else LightTheme
}

MaterialTheme(colors) {
Scaffold(
Expand Down
17 changes: 17 additions & 0 deletions sample/src/main/kotlin/me/saket/swipe/sample/theme/Theme.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package me.saket.swipe.sample.theme

import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.ui.graphics.Color

val LightTheme = lightColorScheme(
primary = Color(0xFF007AFF),
background = Color(0xFFCACACF),
surface = Color(0xFFCACACF)
)

val DarkTheme = darkColorScheme(
primary = Color(0xFF64A0E5),
background = Color(0xFF121212),
surface = Color(0xFF121212)
)

0 comments on commit 191eb3e

Please sign in to comment.