BottomSheet: Always use dark scrim

This commit is contained in:
Patryk Michalik
2021-06-26 10:24:07 +02:00
parent b20cb11680
commit ee90d44429
@@ -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)
}
}