https://kotlinlang.org logo
#compose
Title
# compose
j

julioromano

06/23/2022, 1:24 PM
What is the “touch slop” ? I’ve encountered this term in
PointerInputScope.detectTransformGestures()
docstring but I can’t make sense of what it means.
1
j

jw

06/23/2022, 1:25 PM
Amount of distance a motion event has to travel before being considering a drag/fling rather than a touch/click.
🙌 1
j

julioromano

06/23/2022, 1:28 PM
Ohhhh, so some sort of threshold between “static” motion events (tap) and other non-static motion events (drag, pinch, rotate) ?
j

jw

06/23/2022, 1:30 PM
yes. we are imprecise meat bags with fat fingers and shaky wrists so this value ensures you've done significant movement before honoring it.
☝️ 1
☝🏾 1
😅 6
a

Albert Chang

06/23/2022, 2:37 PM
Also when there are multiple gesture detectors, e.g. a vertical scrollable list in a horizontal scrollable pager, they will start capturing pointer input after the pointer moves past touch slop in that axis and this allows the parent to detect the gesture. Otherwise the child will immediately start capturing, leaving no chance to the parent.
23 Views