Skip to content

Commit

Permalink
fix edge to edge
Browse files Browse the repository at this point in the history
  • Loading branch information
kid1412621 committed Apr 29, 2024
1 parent 6bab719 commit 3bbc0a8
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions app/src/main/kotlin/me/nanova/subspace/ui/theme/Theme.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package me.nanova.subspace.ui.theme

import android.app.Activity
import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme
Expand All @@ -10,12 +9,8 @@ import androidx.compose.material3.dynamicLightColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Immutable
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 lightScheme = lightColorScheme(
primary = primaryLight,
Expand Down Expand Up @@ -253,10 +248,6 @@ data class ColorFamily(
val onColorContainer: Color
)

val unspecified_scheme = ColorFamily(
Color.Unspecified, Color.Unspecified, Color.Unspecified, Color.Unspecified
)

@Composable
fun Theme(
darkTheme: Boolean = isSystemInDarkTheme(),
Expand All @@ -273,14 +264,6 @@ fun Theme(
darkTheme -> darkScheme
else -> lightScheme
}
val view = LocalView.current
if (!view.isInEditMode) {
SideEffect {
val window = (view.context as Activity).window
window.statusBarColor = colorScheme.primary.toArgb()
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
}
}

MaterialTheme(
colorScheme = colorScheme,
Expand Down

0 comments on commit 3bbc0a8

Please sign in to comment.