Fixed
Status Update
Comments
ma...@google.com <ma...@google.com>
km...@google.com <km...@google.com>
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit bf2a40df838a34d48b27ccf55050a9435486a512
Author: Kevin Most <kmost@google.com>
Date: Fri Mar 15 11:40:29 2024
[SwipeToDismissBox] Add `gesturesEnabled` parameter
This can be used to conditionally disable swipe-to-drag, for example
while scrolling in a `LazyList`
Change-Id: Idc59f4bc393c36d58022b459056074b1e9986b37
Test: Unit tests pass
Relnote: Added a `gesturesEnabled` parameter to `SwipeToDismissBox`
Bug: 324170119
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/restricted_current.txt
M compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/SwipeToDismissTest.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/SwipeToDismissBox.kt
https://android-review.googlesource.com/3004252
Branch: androidx-main
commit bf2a40df838a34d48b27ccf55050a9435486a512
Author: Kevin Most <kmost@google.com>
Date: Fri Mar 15 11:40:29 2024
[SwipeToDismissBox] Add `gesturesEnabled` parameter
This can be used to conditionally disable swipe-to-drag, for example
while scrolling in a `LazyList`
Change-Id: Idc59f4bc393c36d58022b459056074b1e9986b37
Test: Unit tests pass
Relnote: Added a `gesturesEnabled` parameter to `SwipeToDismissBox`
Bug: 324170119
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/restricted_current.txt
M compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/SwipeToDismissTest.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/SwipeToDismissBox.kt
Description
Jetpack Compose version: 2024.01.00
Jetpack Compose component used: material3.SwipeToDismissBox
When a user scrolls quickly in a vertical list, the horizontal swipe gesture could be triggered by mistake frequently, which consumes the velocity in x-axis from the flinging of a verticle scrolling.
This unexpected behavior is a really annoying experience.
One possible solution is to pass the
enabled
to theModifier.anchoredDraggable
:Then pass the
LazyListState
down to theSwipeToDismissBox
: