From ee90d44429e14b392b161f38e7a4bc2248e7d90a Mon Sep 17 00:00:00 2001 From: Patryk Michalik Date: Sat, 26 Jun 2021 10:24:07 +0200 Subject: [PATCH] `BottomSheet`: Always use dark scrim --- .../ui/preferences/components/BottomSheet.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lawnchair/src/app/lawnchair/ui/preferences/components/BottomSheet.kt b/lawnchair/src/app/lawnchair/ui/preferences/components/BottomSheet.kt index 3060b45c4c..bf2da00f68 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/components/BottomSheet.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/components/BottomSheet.kt @@ -22,7 +22,7 @@ import kotlinx.coroutines.launch @Composable fun BottomSheet( sheetState: BottomSheetState = rememberBottomSheetState(initialValue = ModalBottomSheetValue.Hidden), - scrimColor: Color = ModalBottomSheetDefaults.scrimColor, + scrimColor: Color = BottomSheetDefaults.scrimColor, sheetContent: @Composable () -> Unit, ) { val currentSheetContent by rememberUpdatedState(sheetContent) @@ -164,3 +164,13 @@ class BottomSheetState( ) } } + +object BottomSheetDefaults { + val scrimColor: Color + @Composable + get() = if (MaterialTheme.colors.isLight) { + MaterialTheme.colors.onBackground.copy(alpha = 0.32F) + } else { + MaterialTheme.colors.background.copy(alpha = 0.32F) + } +} \ No newline at end of file