1
1
package org.thoughtcrime.securesms.ui.components
2
2
3
+ import android.app.Activity
4
+ import android.graphics.Color
5
+ import android.os.Build
3
6
import androidx.annotation.DrawableRes
4
7
import androidx.annotation.StringRes
5
8
import androidx.compose.foundation.clickable
@@ -20,6 +23,7 @@ import androidx.compose.material3.Text
20
23
import androidx.compose.material3.rememberModalBottomSheetState
21
24
import androidx.compose.material3.rememberStandardBottomSheetState
22
25
import androidx.compose.runtime.Composable
26
+ import androidx.compose.runtime.DisposableEffect
23
27
import androidx.compose.runtime.SideEffect
24
28
import androidx.compose.ui.Alignment.Companion.CenterVertically
25
29
import androidx.compose.ui.Modifier
@@ -67,12 +71,20 @@ fun BaseBottomSheet(
67
71
// make sure the status and navigation bars follow our theme color's light vs dark
68
72
val view = LocalView .current
69
73
val isLight = LocalColors .current.isLight
70
- (view.parent as ? DialogWindowProvider )?.window?.let { window ->
71
- SideEffect {
74
+
75
+ DisposableEffect (Unit ) {
76
+ val window = (view.parent as ? DialogWindowProvider )?.window
77
+ if (window != null && Build .VERSION .SDK_INT >= Build .VERSION_CODES .Q ) {
78
+ val prev = window.isNavigationBarContrastEnforced
79
+ window.isNavigationBarContrastEnforced = false
72
80
// Set status bar color
73
81
WindowCompat .getInsetsController(window, view).isAppearanceLightStatusBars = isLight
74
82
// Set navigation bar color
75
83
WindowCompat .getInsetsController(window, view).isAppearanceLightNavigationBars = isLight
84
+
85
+ onDispose { window.isNavigationBarContrastEnforced = prev }
86
+ } else {
87
+ onDispose { }
76
88
}
77
89
}
78
90
0 commit comments