What is the “touch slop” ? I’ve encountered this t...
# compose
j
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
Amount of distance a motion event has to travel before being considering a drag/fling rather than a touch/click.
🙌 1
j
Ohhhh, so some sort of threshold between “static” motion events (tap) and other non-static motion events (drag, pinch, rotate) ?
j
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
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.