BottomSheetDialog: fix horizontal nested scrolling

This commit is contained in:
MM20 2022-06-12 20:01:58 +02:00
parent a39e3705e1
commit c8d34ab18a
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -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)
}
}
}