diff --git a/app/src/main/java/chat/revolt/api/settings/GlobalState.kt b/app/src/main/java/chat/revolt/api/settings/GlobalState.kt index 0f7f0168..bcc593de 100644 --- a/app/src/main/java/chat/revolt/api/settings/GlobalState.kt +++ b/app/src/main/java/chat/revolt/api/settings/GlobalState.kt @@ -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 diff --git a/app/src/main/java/chat/revolt/ui/theme/Theme.kt b/app/src/main/java/chat/revolt/ui/theme/Theme.kt index eef00431..fd5dbfd8 100644 --- a/app/src/main/java/chat/revolt/ui/theme/Theme.kt +++ b/app/src/main/java/chat/revolt/ui/theme/Theme.kt @@ -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 + } } \ No newline at end of file