From fee40fe9c95a63b4662a2016095a82a783bd4000 Mon Sep 17 00:00:00 2001 From: Hafiz Date: Tue, 7 Feb 2023 08:48:52 -0500 Subject: [PATCH] Revert status bar color after hiding bottomsheet --- .../android/habitica/ui/views/BottomSheetUtils.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Habitica/src/main/java/com/habitrpg/android/habitica/ui/views/BottomSheetUtils.kt b/Habitica/src/main/java/com/habitrpg/android/habitica/ui/views/BottomSheetUtils.kt index 215e38858..df14f1d16 100644 --- a/Habitica/src/main/java/com/habitrpg/android/habitica/ui/views/BottomSheetUtils.kt +++ b/Habitica/src/main/java/com/habitrpg/android/habitica/ui/views/BottomSheetUtils.kt @@ -77,9 +77,9 @@ private fun BottomSheetWrapper( var isSheetOpened by remember { mutableStateOf(false) } val systemUiController = rememberSystemUiController() - val statusBarColor = colorResource(R.color.content_background).copy(alpha = 0.3f) + val statusBarColor = colorResource(R.color.content_background) DisposableEffect(systemUiController) { - systemUiController.setStatusBarColor(statusBarColor, darkIcons = true) + systemUiController.setStatusBarColor(statusBarColor.copy(alpha = 0.3f), darkIcons = true) onDispose {} } @@ -132,7 +132,10 @@ private fun BottomSheetWrapper( when (modalBottomSheetState.currentValue) { ModalBottomSheetValue.Hidden -> { when { - isSheetOpened -> parent.removeView(composeView) + isSheetOpened -> { + systemUiController.setStatusBarColor(statusBarColor, darkIcons = false) + parent.removeView(composeView) + } else -> { isSheetOpened = true modalBottomSheetState.show()