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 android.os.Build
|
||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
import androidx.activity.SystemBarStyle
|
import androidx.activity.SystemBarStyle
|
||||||
|
import androidx.activity.compose.LocalActivity
|
||||||
import androidx.activity.enableEdgeToEdge
|
import androidx.activity.enableEdgeToEdge
|
||||||
import androidx.compose.foundation.isSystemInDarkTheme
|
import androidx.compose.foundation.isSystemInDarkTheme
|
||||||
import androidx.compose.material3.ColorScheme
|
import androidx.compose.material3.ColorScheme
|
||||||
|
|
@ -135,7 +136,7 @@ fun ElementTheme(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (applySystemBarsUpdate) {
|
if (applySystemBarsUpdate) {
|
||||||
val activity = LocalContext.current as? ComponentActivity
|
val activity = LocalActivity.current as? ComponentActivity
|
||||||
LaunchedEffect(statusBarColorScheme, darkTheme, lightStatusBar) {
|
LaunchedEffect(statusBarColorScheme, darkTheme, lightStatusBar) {
|
||||||
activity?.enableEdgeToEdge(
|
activity?.enableEdgeToEdge(
|
||||||
// For Status bar use the background color of the app
|
// 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.ComponentActivity
|
||||||
import androidx.activity.SystemBarStyle
|
import androidx.activity.SystemBarStyle
|
||||||
|
import androidx.activity.compose.LocalActivity
|
||||||
import androidx.activity.enableEdgeToEdge
|
import androidx.activity.enableEdgeToEdge
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.DisposableEffect
|
import androidx.compose.runtime.DisposableEffect
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.graphics.toArgb
|
import androidx.compose.ui.graphics.toArgb
|
||||||
import androidx.compose.ui.platform.LocalContext
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Can be used to force a composable in dark theme.
|
* Can be used to force a composable in dark theme.
|
||||||
|
|
@ -28,7 +28,7 @@ fun ForcedDarkElementTheme(
|
||||||
) {
|
) {
|
||||||
val colorScheme = MaterialTheme.colorScheme
|
val colorScheme = MaterialTheme.colorScheme
|
||||||
val wasDarkTheme = !ElementTheme.colors.isLight
|
val wasDarkTheme = !ElementTheme.colors.isLight
|
||||||
val activity = LocalContext.current as? ComponentActivity
|
val activity = LocalActivity.current as? ComponentActivity
|
||||||
DisposableEffect(Unit) {
|
DisposableEffect(Unit) {
|
||||||
onDispose {
|
onDispose {
|
||||||
activity?.enableEdgeToEdge(
|
activity?.enableEdgeToEdge(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue