Revert "app: add dynamic colors support to Compose"
This reverts commit 2a9d2177a5
.
This commit is contained in:
parent
a3f3ad184b
commit
2cf3ddf2aa
1 changed files with 5 additions and 12 deletions
|
@ -1,11 +1,8 @@
|
||||||
package dev.msfjarvis.aps.ui.theme
|
package dev.msfjarvis.aps.ui.theme
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import androidx.compose.foundation.isSystemInDarkTheme
|
import androidx.compose.foundation.isSystemInDarkTheme
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.darkColorScheme
|
import androidx.compose.material3.darkColorScheme
|
||||||
import androidx.compose.material3.dynamicDarkColorScheme
|
|
||||||
import androidx.compose.material3.dynamicLightColorScheme
|
|
||||||
import androidx.compose.material3.lightColorScheme
|
import androidx.compose.material3.lightColorScheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
|
||||||
|
@ -67,16 +64,12 @@ private val DarkThemeColors =
|
||||||
)
|
)
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun APSTheme(
|
fun APSTheme(useDarkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) {
|
||||||
useDynamicColors: Boolean = true,
|
|
||||||
useDarkTheme: Boolean = isSystemInDarkTheme(),
|
|
||||||
context: Context,
|
|
||||||
content: @Composable () -> Unit,
|
|
||||||
) {
|
|
||||||
val colors =
|
val colors =
|
||||||
when (useDarkTheme) {
|
if (!useDarkTheme) {
|
||||||
true -> if (useDynamicColors) dynamicDarkColorScheme(context) else DarkThemeColors
|
LightThemeColors
|
||||||
false -> if (useDynamicColors) dynamicLightColorScheme(context) else LightThemeColors
|
} else {
|
||||||
|
DarkThemeColors
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialTheme(colorScheme = colors, typography = AppTypography, content = content)
|
MaterialTheme(colorScheme = colors, typography = AppTypography, content = content)
|
||||||
|
|
Loading…
Reference in a new issue