Austin Nelson
03/20/2022, 7:02 PMJohn Nichol
03/21/2022, 6:48 AMSteve Bower [G]
03/24/2022, 11:04 AM/**
* Override a composable to be unswipeable by blocking the
* swipe-to-dismiss gesture.
*
* When a composable is on top of another composable that
* supports swipe-to-dismiss, then [Modifier.unswipeable]
* can be applied to the top composable to handle and ignore
* the swipe gesture. For example, this may be used to
* prevent swiping away a dialog.
*/
public fun Modifier.unswipeable() =
this.then(
Modifier.draggable(
orientation = Orientation.Horizontal,
enabled = true,
state = DraggableState {}
)
)
Austin Nelson
03/25/2022, 7:00 PMAlert
or Confirmation
and Dialog
doesn’t have a modifier property 😕
This also didn’t work. Any other suggestions?
SwipeToDismissBox(
modifier = Modifier.unswipeable(),
state = state,
) {
HsvColorPicker(
modifier = Modifier.fillMaxSize(),
controller = controller,
onColorChanged = {
}
)
}
Steve Bower [G]
03/29/2022, 1:07 PMAustin Nelson
03/30/2022, 12:41 PM