@@ -20,13 +20,17 @@ import androidx.compose.material3.Text
20
20
import androidx.compose.material3.rememberModalBottomSheetState
21
21
import androidx.compose.material3.rememberStandardBottomSheetState
22
22
import androidx.compose.runtime.Composable
23
+ import androidx.compose.runtime.SideEffect
23
24
import androidx.compose.ui.Alignment.Companion.CenterVertically
24
25
import androidx.compose.ui.Modifier
26
+ import androidx.compose.ui.platform.LocalView
25
27
import androidx.compose.ui.res.painterResource
26
28
import androidx.compose.ui.res.stringResource
27
29
import androidx.compose.ui.text.style.TextAlign
28
30
import androidx.compose.ui.tooling.preview.Preview
29
31
import androidx.compose.ui.tooling.preview.PreviewParameter
32
+ import androidx.compose.ui.window.DialogWindowProvider
33
+ import androidx.core.view.WindowCompat
30
34
import network.loki.messenger.R
31
35
import org.thoughtcrime.securesms.ui.qaTag
32
36
import org.thoughtcrime.securesms.ui.theme.LocalColors
@@ -58,9 +62,22 @@ fun BaseBottomSheet(
58
62
topEnd = LocalDimensions .current.xsSpacing
59
63
),
60
64
dragHandle = dragHandle,
61
- containerColor = LocalColors .current.backgroundSecondary,
62
- content = content
63
- )
65
+ containerColor = LocalColors .current.backgroundSecondary
66
+ ){
67
+ // make sure the status and navigation bars follow our theme color's light vs dark
68
+ val view = LocalView .current
69
+ val isLight = LocalColors .current.isLight
70
+ (view.parent as ? DialogWindowProvider )?.window?.let { window ->
71
+ SideEffect {
72
+ // Set status bar color
73
+ WindowCompat .getInsetsController(window, view).isAppearanceLightStatusBars = isLight
74
+ // Set navigation bar color
75
+ WindowCompat .getInsetsController(window, view).isAppearanceLightNavigationBars = isLight
76
+ }
77
+ }
78
+
79
+ content()
80
+ }
64
81
}
65
82
66
83
0 commit comments