feat: default theme is now M3 dynamic colours
Signed-off-by: Infi <wingit@geist.ga>
This commit is contained in:
parent
dc8abf3494
commit
795f288ab8
|
|
@ -2,9 +2,10 @@ package chat.revolt.api.settings
|
|||
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import chat.revolt.ui.theme.Theme
|
||||
import chat.revolt.ui.theme.getDefaultTheme
|
||||
|
||||
object GlobalState {
|
||||
private var _theme = mutableStateOf(Theme.Revolt)
|
||||
private var _theme = mutableStateOf(getDefaultTheme())
|
||||
val theme
|
||||
get() = _theme.value
|
||||
|
||||
|
|
|
|||
|
|
@ -116,4 +116,11 @@ fun RevoltTheme(
|
|||
|
||||
fun systemSupportsDynamicColors(): Boolean {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.S
|
||||
}
|
||||
|
||||
fun getDefaultTheme(): Theme {
|
||||
return when {
|
||||
systemSupportsDynamicColors() -> Theme.M3Dynamic
|
||||
else -> Theme.Revolt
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue