summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Helen Qin <helenqin@google.com> 2023-12-06 18:46:58 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-12-06 18:46:58 +0000
commit961d2b4efd8e1bca2739fd9ea0423f183cbcba1b (patch)
tree855b1af6636eecf1229730fd5a28bfd08b207eee
parentc2f9078061e7ec76af161b27a55eef0348089ea6 (diff)
parent2f891f63f381be656836e71c9f260e256185fcda (diff)
Merge "Short term solution for the in-animation-dismissal-freeze bug." into main
-rw-r--r--packages/CredentialManager/src/com/android/credentialmanager/common/ui/BottomSheet.kt7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/CredentialManager/src/com/android/credentialmanager/common/ui/BottomSheet.kt b/packages/CredentialManager/src/com/android/credentialmanager/common/ui/BottomSheet.kt
index a5998faa68ad..db69b8bdf42b 100644
--- a/packages/CredentialManager/src/com/android/credentialmanager/common/ui/BottomSheet.kt
+++ b/packages/CredentialManager/src/com/android/credentialmanager/common/ui/BottomSheet.kt
@@ -60,14 +60,15 @@ fun ModalBottomSheet(
sheetContent = sheetContent,
sheetShape = EntryShape.TopRoundedCorner,
) {}
- LaunchedEffect(state.currentValue) {
+ LaunchedEffect(state.currentValue, state.targetValue) {
if (state.currentValue == ModalBottomSheetValue.Hidden) {
if (isInitialRender) {
onInitialRenderComplete()
scope.launch { state.show() }
- } else {
+ } else if (state.targetValue == ModalBottomSheetValue.Hidden) {
+ // Only dismiss ui when the motion is downwards
onDismiss()
}
}
}
-} \ No newline at end of file
+}