Hello everyone :android-wave: . I've been playing ...
# compose
c
Hello everyone đź‘‹ . I've been playing with
SwipeToDismiss
and
swipeable/draggable
and was wondering if there's a configuration I'm missing to completely disallow swiping in a certain direction? Currently I see we have in
swipeable
a resistanceConfig that you can define. This would make it hard to swipe on a certain side, but not impossible.
r
I have not used
SwipeToDismiss
but I see that it has this parameter:
directions: Set<DismissDirection> = setOf(EndToStart, StartToEnd)
. Couldn't you just call it with
directions = setOf(StartToEnd)
, for example?
c
Yep! That is what I'm currently doing except I use
EndToStart
. It still allows you to drag from
StartToEnd
it just doesn't allow it to be dismissed. There's also Resistance that basically indicates to the user that you can't swipe in the direction you don't specify. I'd like to get rid of the swipe altogether if you can't do it in that direction
r
I played around with this a bit (a good opportunity to learn something new about Compose -- thanks 🙂) and I could not find a solution either. (Sometimes the answer to these questions is "this is how Material works", but I did not readily find a definition for swiping to dismiss.)