Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downgraded minSdk version #22

Merged
merged 2 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
minSdk = "23"
minSdk = "21"
compileSdk = "34"
kotlin = "1.9.10"
agp = "8.1.0"
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()
saket marked this conversation as resolved.
Show resolved Hide resolved
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)
)