diff --git a/apps/giga-wear/client/build.gradle.kts b/apps/giga-wear/client/build.gradle.kts index fafb6ec..0e8fc35 100644 --- a/apps/giga-wear/client/build.gradle.kts +++ b/apps/giga-wear/client/build.gradle.kts @@ -8,7 +8,7 @@ plugins { alias(libs.plugins.convention.serialization) } -val appVersion = "1.0.2" +val appVersion = "1.0.3" android { buildFeatures { buildConfig = true } diff --git a/apps/giga-wear/client/src/main/kotlin/ru/shadowsparky/gigawear/presentation/MainActivity.kt b/apps/giga-wear/client/src/main/kotlin/ru/shadowsparky/gigawear/presentation/MainActivity.kt index 98aa48a..d3b578f 100644 --- a/apps/giga-wear/client/src/main/kotlin/ru/shadowsparky/gigawear/presentation/MainActivity.kt +++ b/apps/giga-wear/client/src/main/kotlin/ru/shadowsparky/gigawear/presentation/MainActivity.kt @@ -1,11 +1,8 @@ package ru.shadowsparky.gigawear.presentation -import android.os.Build import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent -import androidx.compose.material3.dynamicDarkColorScheme -import androidx.compose.runtime.CompositionLocalProvider import com.arkivanov.decompose.retainedComponent import org.koin.android.ext.android.inject import ru.shadowsparky.gigawear.presentation.auth.AuthScreen @@ -13,8 +10,6 @@ import ru.shadowsparky.gigawear.presentation.chat.ChatScreen import ru.shadowsparky.gigawear.presentation.nav.Child import ru.shadowsparky.gigawear.presentation.routing.RoutingScreen import ru.shadowsparky.ui.nav.Nav -import ru.shadowsparky.ui.theme.LocalColorSchemeProvider -import ru.shadowsparky.ui.theme.darkScheme class MainActivity : ComponentActivity() { private val rootFactory by inject() @@ -23,18 +18,11 @@ class MainActivity : ComponentActivity() { super.onCreate(savedInstanceState) val root = retainedComponent { rootFactory.create(it) } setContent { - val scheme = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { - dynamicDarkColorScheme(this) - } else { - darkScheme - } - CompositionLocalProvider(LocalColorSchemeProvider provides scheme) { - Nav(root) { child, _ -> - when (child) { - is Child.MainChild -> ChatScreen(child.component) - is Child.AuthChild -> AuthScreen(child.component) - is Child.RoutingChild -> RoutingScreen(child.component) - } + Nav(root) { child, _ -> + when (child) { + is Child.MainChild -> ChatScreen(child.component) + is Child.AuthChild -> AuthScreen(child.component) + is Child.RoutingChild -> RoutingScreen(child.component) } } } diff --git a/libs/ui/src/commonMain/kotlin/ru/shadowsparky/ui/components/AlertContent.kt b/libs/ui/src/commonMain/kotlin/ru/shadowsparky/ui/components/AlertContent.kt index 3404930..42efc79 100644 --- a/libs/ui/src/commonMain/kotlin/ru/shadowsparky/ui/components/AlertContent.kt +++ b/libs/ui/src/commonMain/kotlin/ru/shadowsparky/ui/components/AlertContent.kt @@ -17,7 +17,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import androidx.compose.ui.window.DialogProperties import ru.shadowsparky.ui.theme.getColorScheme -import ru.shadowsparky.ui.util.isWear @OptIn(ExperimentalMaterial3Api::class, ExperimentalMaterial3ExpressiveApi::class) @Composable @@ -45,7 +44,7 @@ fun AlertContent( } } MaterialExpressiveTheme(getColorScheme()) { - if (isTv() || isWear()) { + if (isTv()) { BasicAlertDialog( onDismissRequest = onDismissRequest, modifier = modifier, diff --git a/libs/ui/src/commonMain/kotlin/ru/shadowsparky/ui/theme/Theme.kt b/libs/ui/src/commonMain/kotlin/ru/shadowsparky/ui/theme/Theme.kt index 6f8332e..7f5d1fa 100644 --- a/libs/ui/src/commonMain/kotlin/ru/shadowsparky/ui/theme/Theme.kt +++ b/libs/ui/src/commonMain/kotlin/ru/shadowsparky/ui/theme/Theme.kt @@ -6,6 +6,7 @@ import androidx.compose.material3.darkColorScheme import androidx.compose.material3.lightColorScheme import androidx.compose.runtime.Composable import androidx.compose.runtime.compositionLocalOf +import ru.shadowsparky.ui.util.isWear val lightScheme = lightColorScheme( primary = primaryLight, @@ -88,7 +89,7 @@ val LocalColorSchemeProvider = compositionLocalOf { null } @Composable fun getColorScheme(): ColorScheme { return LocalColorSchemeProvider.current ?: when { - isSystemInDarkTheme() -> darkDynamicScheme() ?: darkScheme + isSystemInDarkTheme() || isWear() -> darkDynamicScheme() ?: darkScheme else -> lightDynamicScheme() ?: lightScheme } }