From ebeb6becb64da687275c4ffd0813b3f73b16256f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 12 Mar 2023 04:41:59 +0000 Subject: [PATCH] Update androidx.compose.material3 to v1.1.0-alpha08 (#3360) * Update dependency androidx.compose.material3:material3 to v1.1.0-alpha08 * Migrate confirmStateChange * Remove bottomSheetState.isAnimationRunning --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Goooler --- build.gradle | 2 +- .../src/app/lawnchair/ui/util/ProvideBottomSheetHandler.kt | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) 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) {