feat: slash command autocomplete, dynamic theme colors, interactive model selection & drawer icons
This commit is contained in:
1 parent
c06e8417db
commit
3830236585
5 files changed
+314
-67
No files matched your search
@@ -1,12 +1,16 @@
|
||||
package com.m57.hermescontrol.theme
|
||||
|
||||
import android.os.Build
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.material3.dynamicDarkColorScheme
|
||||
import androidx.compose.material3.dynamicLightColorScheme
|
||||
import androidx.compose.material3.lightColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.compositionLocalOf
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
|
||||
enum class ThemePreference { SYSTEM, LIGHT, DARK }
|
||||
|
||||
@@ -68,7 +72,15 @@ fun HermesControlTheme(
|
||||
ThemePreference.DARK -> true
|
||||
}
|
||||
|
||||
val colorScheme = if (darkTheme) HermesDarkColorScheme else HermesLightColorScheme
|
||||
val context = LocalContext.current
|
||||
val dynamicColor = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S
|
||||
val colorScheme =
|
||||
when {
|
||||
dynamicColor && darkTheme -> dynamicDarkColorScheme(context)
|
||||
dynamicColor && !darkTheme -> dynamicLightColorScheme(context)
|
||||
darkTheme -> HermesDarkColorScheme
|
||||
else -> HermesLightColorScheme
|
||||
}
|
||||
|
||||
MaterialTheme(
|
||||
colorScheme = colorScheme,
|
||||
|
||||
Reference in new issue
Block a user