mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-25 04:12:14 +00:00
Add: Dynamic theme to compose
This commit is contained in:
parent
45161514cc
commit
5ecb48871d
@ -3,9 +3,13 @@ package com.machiav3lli.fdroid.ui.compose.theme
|
|||||||
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
|
||||||
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import com.machiav3lli.fdroid.utility.isBlackTheme
|
import com.machiav3lli.fdroid.utility.isBlackTheme
|
||||||
|
import com.machiav3lli.fdroid.utility.isDynamicColorsTheme
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun AppTheme(
|
fun AppTheme(
|
||||||
@ -15,7 +19,8 @@ fun AppTheme(
|
|||||||
) {
|
) {
|
||||||
MaterialTheme(
|
MaterialTheme(
|
||||||
colorScheme = when {
|
colorScheme = when {
|
||||||
//dynamicTheme -> dynamicDarkColorScheme(LocalContext.current)
|
isDynamicColorsTheme && isSystemInDarkTheme() -> dynamicDarkColorScheme(LocalContext.current)
|
||||||
|
isDynamicColorsTheme -> dynamicLightColorScheme(LocalContext.current)
|
||||||
darkTheme && blackTheme -> BlackColors
|
darkTheme && blackTheme -> BlackColors
|
||||||
darkTheme -> DarkColors
|
darkTheme -> DarkColors
|
||||||
else -> LightColors
|
else -> LightColors
|
||||||
|
Loading…
x
Reference in New Issue
Block a user