Status Update
Comments
ma...@google.com <ma...@google.com>
se...@google.com <se...@google.com> #2
Thanks for filing this issue!
While it doesn't seem directly related to third-party cookie dependencies or Privacy Sandbox, we may be missing something. If you are confident that this issue is related to third-party cookies, please submit a
This thread will no longer be monitored for responses.
km...@google.com <km...@google.com>
ap...@google.com <ap...@google.com> #3
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
km...@google.com <km...@google.com>
co...@gmail.com <co...@gmail.com> #4
We appreciate the fix, however this introduces its own tradeoffs with the scenario the original reporter detailed. When isScrollInProgress()
changes, gesturesEnabled
changes between true/false, which in turn causes SwipeToDismissBox
to re-compose. This is causing a performance hit for us, as everytime scrolling starts/stops, all of our list items are re-composed.
Now, we're left in the situation where we have to pick between having the annoyance of accidental swipes when scrolling, or having poor performance on lower-end devices.
Is it possible to get a solution where changing gesturesEnabled
doesn't re-invoke the composition phase?
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
: