From d181b39c554e32731007b087a58be09b080f9bbb Mon Sep 17 00:00:00 2001 From: mezhendosina Date: Wed, 21 Jun 2023 14:34:59 +0500 Subject: [PATCH] =?UTF-8?q?Status=20bar=20=D1=82=D0=B5=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D1=8C=20=D0=B4=D0=BE=D0=BB=D0=B6=D0=B5=D0=BD=20=D0=B1=D1=8B?= =?UTF-8?q?=D1=82=D1=8C=20=D0=BF=D1=80=D0=BE=D0=B7=D1=80=D0=B0=D1=87=D0=BD?= =?UTF-8?q?=D1=8B=D0=BC=20:)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ru/nm17/narodmon/ui/theme/Theme.kt | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/theme/Theme.kt b/app/src/main/java/ru/nm17/narodmon/ui/theme/Theme.kt index 666d520..4b5a002 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/theme/Theme.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/theme/Theme.kt @@ -10,15 +10,16 @@ import androidx.compose.material3.dynamicLightColorScheme import androidx.compose.material3.lightColorScheme import androidx.compose.runtime.Composable import androidx.compose.runtime.SideEffect +import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.toArgb import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalView import androidx.core.view.WindowCompat private val DarkColorScheme = darkColorScheme( - primary = Purple80, - secondary = PurpleGrey80, - tertiary = Pink80 + primary = Purple80, + secondary = PurpleGrey80, + tertiary = Pink80 ) private val LightColorScheme = lightColorScheme( @@ -26,23 +27,23 @@ private val LightColorScheme = lightColorScheme( secondary = PurpleGrey80, tertiary = Pink80 - /* Other default colors to override - background = Color(0xFFFFFBFE), - surface = Color(0xFFFFFBFE), - onPrimary = Color.White, - onSecondary = Color.White, - onTertiary = Color.White, - onBackground = Color(0xFF1C1B1F), - onSurface = Color(0xFF1C1B1F), - */ + /* Other default colors to override +background = Color(0xFFFFFBFE), +surface = Color(0xFFFFFBFE), +onPrimary = Color.White, +onSecondary = Color.White, +onTertiary = Color.White, +onBackground = Color(0xFF1C1B1F), +onSurface = Color(0xFF1C1B1F), +*/ ) @Composable fun NarodMonTheme( - darkTheme: Boolean = isSystemInDarkTheme(), - // Dynamic color is available on Android 12+ - dynamicColor: Boolean = true, - content: @Composable () -> Unit + darkTheme: Boolean = isSystemInDarkTheme(), + // Dynamic color is available on Android 12+ + dynamicColor: Boolean = true, + content: @Composable () -> Unit ) { val colorScheme = when { dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> { @@ -57,14 +58,16 @@ fun NarodMonTheme( if (!view.isInEditMode) { SideEffect { val window = (view.context as Activity).window - window.statusBarColor = colorScheme.primary.toArgb() - WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme + WindowCompat.setDecorFitsSystemWindows(window, false) + window.statusBarColor = Color.Transparent.toArgb() + + WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = !darkTheme } } MaterialTheme( - colorScheme = colorScheme, - typography = Typography, - content = content + colorScheme = colorScheme, + typography = Typography, + content = content ) } \ No newline at end of file