From c8d34ab18a6066bd1fb685096c1c91dbcb71eee1 Mon Sep 17 00:00:00 2001 From: MM20 <15646950+MM2-0@users.noreply.github.com> Date: Sun, 12 Jun 2022 20:01:58 +0200 Subject: [PATCH] BottomSheetDialog: fix horizontal nested scrolling --- .../de/mm20/launcher2/ui/component/BottomSheetDialog.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/src/main/java/de/mm20/launcher2/ui/component/BottomSheetDialog.kt b/ui/src/main/java/de/mm20/launcher2/ui/component/BottomSheetDialog.kt index 39ef8808..90a81082 100644 --- a/ui/src/main/java/de/mm20/launcher2/ui/component/BottomSheetDialog.kt +++ b/ui/src/main/java/de/mm20/launcher2/ui/component/BottomSheetDialog.kt @@ -57,7 +57,7 @@ fun BottomSheetDialog( return super.onPreScroll(available, source) } val c = swipeState.performDrag(available.y) - return Offset(available.x, c) + return Offset(0f, c) } override fun onPostScroll( @@ -69,7 +69,7 @@ fun BottomSheetDialog( return super.onPreScroll(available, source) } val c = swipeState.performDrag(available.y) - return Offset(available.x, c) + return Offset(0f, c) } override suspend fun onPreFling(available: Velocity): Velocity { @@ -77,7 +77,7 @@ fun BottomSheetDialog( return super.onPreFling(available) } swipeState.performFling(available.y) - return available + return available.copy(x = 0f) } override suspend fun onPostFling( @@ -88,7 +88,7 @@ fun BottomSheetDialog( return super.onPreFling(available) } swipeState.performFling(available.y) - return available + return available.copy(x = 0f) } } }