Fix lint issue
This commit is contained in:
committed by
Benoit Marty
parent
60e9ec7936
commit
9c994da832
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user