Fix bottom sheets auto closing

This commit is contained in:
MM20 2024-04-01 22:17:58 +02:00
parent 2412e37e20
commit 494a18ac97
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -1,5 +1,6 @@
package de.mm20.launcher2.ui.component
import android.util.Log
import androidx.activity.compose.BackHandler
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.exponentialDecay
@ -107,8 +108,8 @@ fun BottomSheetDialog(
}
}
LaunchedEffect(draggableState.currentValue) {
if (isOpenAnimationFinished && draggableState.currentValue == SwipeState.Dismiss) {
LaunchedEffect(draggableState.settledValue) {
if (isOpenAnimationFinished && draggableState.settledValue == SwipeState.Dismiss) {
onDismissRequest()
} else {
isOpenAnimationFinished = true