diff --git a/build.gradle b/build.gradle index 75a31de003..dba7252039 100644 --- a/build.gradle +++ b/build.gradle @@ -329,7 +329,7 @@ dependencies { implementation "androidx.compose.material:material-icons-extended" implementation "androidx.compose.material:material" implementation "androidx.compose.runtime:runtime-livedata" - implementation 'androidx.compose.material3:material3:1.1.0-alpha06' + implementation 'androidx.compose.material3:material3:1.1.0-alpha08' implementation "androidx.constraintlayout:constraintlayout:2.1.4" implementation "androidx.activity:activity-compose:1.6.1" implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.6.0" diff --git a/lawnchair/src/app/lawnchair/ui/util/ProvideBottomSheetHandler.kt b/lawnchair/src/app/lawnchair/ui/util/ProvideBottomSheetHandler.kt index 820b9ca96f..3d58fb11af 100644 --- a/lawnchair/src/app/lawnchair/ui/util/ProvideBottomSheetHandler.kt +++ b/lawnchair/src/app/lawnchair/ui/util/ProvideBottomSheetHandler.kt @@ -34,8 +34,8 @@ import androidx.compose.ui.layout.layout import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.unit.Constraints import androidx.compose.ui.unit.dp -import kotlinx.coroutines.launch import kotlin.math.max +import kotlinx.coroutines.launch import androidx.compose.material.MaterialTheme as Material2Theme internal val LocalBottomSheetHandler = staticCompositionLocalOf { BottomSheetHandler() } @@ -55,7 +55,7 @@ fun ProvideBottomSheetHandler( val bottomSheetState = remember { ModalBottomSheetState( initialValue = ModalBottomSheetValue.Hidden, - confirmStateChange = { + confirmValueChange = { if (it == ModalBottomSheetValue.Hidden) onDismiss() true }, @@ -82,8 +82,7 @@ fun ProvideBottomSheetHandler( ModalBottomSheetLayout( sheetContent = { - val isSheetShown = bottomSheetState.isAnimationRunning || bottomSheetState.isVisible - BackHandler(enabled = isSheetShown) { + BackHandler(enabled = bottomSheetState.isVisible) { bottomSheetHandler.hide() } CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.onSurface) {