Zoltan Demant
03/21/2025, 8:22 AMModifier.detectDragGesturesAfterLongPress
and move items in a LazyColumn
around, right at the moment where their indexes swap, theres a brief highlight from the Modifier.clickable
indication that Id like to get rid off. I think its due to a recomposition happening to reflect the items new placements (which is okay); and that the clickable modifier is triggered first, before leading into the event being a long press. Any ideas on how I can work around it? Code in 🧵Zoltan Demant
03/21/2025, 8:25 AMCard(
modifier = Modifier.draggable(),
onClick = {
...
},
content = {
...
},
)
Modifier.draggable
is basically Modifier.detectDragGesturesAfterLongPress
, just involving logic for moving the items around, which I dont think is relevant.
Note: I think I could solve it by manually specifyingin my click handler during drag events. Or it could help to place the draggable modifier last in the chain. I dont know if the latter works, but regardless - Id prefer a better solution since I need the onClick parameter in my card to be used "in the card" for other styling logic, elevation, etc.indication = null
Zoltan Demant
03/21/2025, 8:28 AMonDrag
I do change.consume()
not sure if theres anything else I can do there to solve this?Zoltan Demant
03/25/2025, 12:25 PMdorche
03/25/2025, 12:57 PMZoltan Demant
03/25/2025, 1:35 PMZach Klippenstein (he/him) [MOD]
03/25/2025, 4:00 PMZoltan Demant
03/26/2025, 5:58 AMZach Klippenstein (he/him) [MOD]
03/26/2025, 2:28 PMZoltan Demant
03/26/2025, 2:33 PMZach Klippenstein (he/him) [MOD]
03/26/2025, 2:44 PMkey
composable btw. Very similar to movable content behavior wise but simpler mechanism under the hood and it’s been around since 1.0Zoltan Demant
03/27/2025, 1:16 PM