Skip to content

Commit

Permalink
Minor upgrade.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohanraj293 committed Apr 12, 2024
1 parent 681c7ef commit d5e251b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tarka-ui/src/main/java/com/tarkalabs/tarkaui/theme/Theme.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
package com.tarkalabs.tarkaui.theme

import android.app.Activity
import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.dynamicDarkColorScheme
import androidx.compose.material3.dynamicLightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.SideEffect
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalView
import androidx.core.view.WindowCompat

@Composable fun TUITheme(
darkTheme: Boolean = isSystemInDarkTheme(),
Expand All @@ -22,6 +27,7 @@ import androidx.compose.ui.platform.LocalView
SideEffect {
val window = (view.context as Activity).window
window.statusBarColor = colors.surface.toArgb()
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = !darkTheme
}
}

Expand Down

0 comments on commit d5e251b

Please sign in to comment.