@@ -13,6 +13,7 @@ import androidx.compose.animation.togetherWith
1313import androidx.compose.foundation.background
1414import androidx.compose.foundation.interaction.DragInteraction
1515import androidx.compose.foundation.interaction.PressInteraction
16+ import androidx.compose.foundation.isSystemInDarkTheme
1617import androidx.compose.foundation.layout.Arrangement
1718import androidx.compose.foundation.layout.Box
1819import androidx.compose.foundation.layout.Column
@@ -35,6 +36,7 @@ import androidx.compose.foundation.verticalScroll
3536import androidx.compose.material3.Icon
3637import androidx.compose.material3.Text
3738import androidx.compose.runtime.Composable
39+ import androidx.compose.runtime.DisposableEffect
3840import androidx.compose.runtime.LaunchedEffect
3941import androidx.compose.runtime.State
4042import androidx.compose.runtime.mutableIntStateOf
@@ -67,12 +69,14 @@ import com.patrykandpatrick.liftapp.ui.component.LiftAppButton
6769import com.patrykandpatrick.liftapp.ui.component.LiftAppButtonDefaults
6870import com.patrykandpatrick.liftapp.ui.component.LiftAppHorizontalDivider
6971import com.patrykandpatrick.liftapp.ui.component.LiftAppScaffold
72+ import com.patrykandpatrick.liftapp.ui.component.windowInsetsControllerCompat
7073import com.patrykandpatrick.liftapp.ui.dimens.LocalDimens
7174import com.patrykandpatrick.liftapp.ui.dimens.dimens
7275import com.patrykandpatrick.liftapp.ui.modifier.topTintedEdge
7376import com.patrykandpatrick.liftapp.ui.theme.BottomSheetShape
7477import com.patrykandpatrick.liftapp.ui.theme.ButtonBorderShape
7578import com.patrykandpatrick.liftapp.ui.theme.ButtonShape
79+ import com.patrykandpatrick.liftapp.ui.theme.LiftAppTheme
7680import com.patrykandpatrick.liftapp.ui.theme.bottomSheetShadow
7781import com.patrykandpatrick.liftapp.ui.theme.colorScheme
7882import com.patrykandpatryk.liftapp.core.R
@@ -117,6 +121,8 @@ fun WorkoutScreen(modifier: Modifier = Modifier, viewModel: WorkoutViewModel = h
117121
118122 RestTimerEffect (viewModel, restTimerService)
119123
124+ SetStatusAppearance ()
125+
120126 LiftAppScaffold (
121127 topBar = {
122128 CompactTopAppBar (
@@ -130,6 +136,11 @@ fun WorkoutScreen(modifier: Modifier = Modifier, viewModel: WorkoutViewModel = h
130136 navigationIcon = {
131137 AppBars .BackArrow (onClick = { viewModel.onAction(Action .PopBackStack ) })
132138 },
139+ colors =
140+ AppBars .colors(
141+ containerColor = colorScheme.bottomSheetScrim,
142+ contentColor = colorScheme.onBottomSheetScrim,
143+ ),
133144 )
134145 },
135146 bottomBar = {
@@ -138,6 +149,7 @@ fun WorkoutScreen(modifier: Modifier = Modifier, viewModel: WorkoutViewModel = h
138149 }
139150 },
140151 modifier = modifier,
152+ containerColor = colorScheme.bottomSheetScrim,
141153 ) { paddingValues ->
142154 if (workout != null ) {
143155 Content (
@@ -189,7 +201,11 @@ private fun Content(
189201
190202 Box (modifier = modifier.imePadding()) {
191203 Backdrop (
192- backContent = { ExerciseListPicker (workout, wheelPickerState, backdropState) },
204+ backContent = {
205+ LiftAppTheme (darkTheme = true ) {
206+ ExerciseListPicker (workout, wheelPickerState, backdropState)
207+ }
208+ },
193209 backPeekHeight = { wheelPickerState.maxItemHeight.toDp() },
194210 contentPeekHeight = { 200 .dp },
195211 state = backdropState,
@@ -202,7 +218,7 @@ private fun Content(
202218 .background(
203219 brush =
204220 Brush .verticalGradient(
205- listOf (colorScheme.surface, colorScheme.background )
221+ listOf (colorScheme.surface, colorScheme.surface )
206222 ),
207223 shape = BottomSheetShape ,
208224 )
@@ -271,8 +287,7 @@ private fun BottomBar(
271287 val padding = LocalDimens .current.padding
272288 Column (
273289 verticalArrangement = Arrangement .spacedBy(16 .dp),
274- modifier =
275- modifier.background(colorScheme.background).fillMaxWidth().navigationBarsPadding(),
290+ modifier = modifier.background(colorScheme.surface).fillMaxWidth().navigationBarsPadding(),
276291 ) {
277292 Column {
278293 LiftAppHorizontalDivider ()
@@ -442,6 +457,20 @@ private fun Page(
442457 }
443458}
444459
460+ @Composable
461+ fun SetStatusAppearance () {
462+ val windowInsetsController = windowInsetsControllerCompat
463+ val isInDarkTheme = isSystemInDarkTheme()
464+
465+ DisposableEffect (windowInsetsController, isInDarkTheme) {
466+ windowInsetsController?.let { controller ->
467+ val initial = ! isInDarkTheme
468+ controller.isAppearanceLightStatusBars = false
469+ onDispose { controller.isAppearanceLightStatusBars = initial }
470+ } ? : onDispose {}
471+ }
472+ }
473+
445474@MultiDevicePreview
446475@Composable
447476private fun WorkoutScreenPreview () {
0 commit comments