Fix lint issue
This commit is contained in:
parent
2d1a3ac929
commit
9938b74669
2 changed files with 4 additions and 3 deletions
|
|
@ -10,6 +10,7 @@ package io.element.android.compound.theme
|
|||
import android.os.Build
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.SystemBarStyle
|
||||
import androidx.activity.compose.LocalActivity
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material3.ColorScheme
|
||||
|
|
@ -135,7 +136,7 @@ fun ElementTheme(
|
|||
}
|
||||
|
||||
if (applySystemBarsUpdate) {
|
||||
val activity = LocalContext.current as? ComponentActivity
|
||||
val activity = LocalActivity.current as? ComponentActivity
|
||||
LaunchedEffect(statusBarColorScheme, darkTheme, lightStatusBar) {
|
||||
activity?.enableEdgeToEdge(
|
||||
// For Status bar use the background color of the app
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@ package io.element.android.compound.theme
|
|||
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.SystemBarStyle
|
||||
import androidx.activity.compose.LocalActivity
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.toArgb
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
|
||||
/**
|
||||
* Can be used to force a composable in dark theme.
|
||||
|
|
@ -28,7 +28,7 @@ fun ForcedDarkElementTheme(
|
|||
) {
|
||||
val colorScheme = MaterialTheme.colorScheme
|
||||
val wasDarkTheme = !ElementTheme.colors.isLight
|
||||
val activity = LocalContext.current as? ComponentActivity
|
||||
val activity = LocalActivity.current as? ComponentActivity
|
||||
DisposableEffect(Unit) {
|
||||
onDispose {
|
||||
activity?.enableEdgeToEdge(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue