From 9c994da8320c734e0d139707d91cd46a42b3e34e Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 3 Oct 2025 20:27:17 +0200 Subject: [PATCH] Fix lint issue --- .../kotlin/io/element/android/compound/theme/ElementTheme.kt | 3 ++- .../element/android/compound/theme/ForcedDarkElementTheme.kt | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/compound/src/main/kotlin/io/element/android/compound/theme/ElementTheme.kt b/libraries/compound/src/main/kotlin/io/element/android/compound/theme/ElementTheme.kt index 08c30cf917..7535de0acd 100644 --- a/libraries/compound/src/main/kotlin/io/element/android/compound/theme/ElementTheme.kt +++ b/libraries/compound/src/main/kotlin/io/element/android/compound/theme/ElementTheme.kt @@ -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 diff --git a/libraries/compound/src/main/kotlin/io/element/android/compound/theme/ForcedDarkElementTheme.kt b/libraries/compound/src/main/kotlin/io/element/android/compound/theme/ForcedDarkElementTheme.kt index fce1a920d0..cd168713ae 100644 --- a/libraries/compound/src/main/kotlin/io/element/android/compound/theme/ForcedDarkElementTheme.kt +++ b/libraries/compound/src/main/kotlin/io/element/android/compound/theme/ForcedDarkElementTheme.kt @@ -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(