Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 224ce4ae authored by Jordan Demeulenaere's avatar Jordan Demeulenaere
Browse files

Remove drag pick-up logic in NestedDraggable

This CL removes the drag pick-up logic in NestedDraggable as it's
currently broken. See b/386916947#comment1 for details.

Bug: 386916947
Test: Removed feature that was not working or even test properly
Flag: EXEMPT NestedDraggable is not used anywhere yet
Change-Id: Ie659f41ec5cf99314aee69c0d8f99f96e6fa3305
parent d77e2885
Loading
Loading
Loading
Loading
+1 −23
Original line number Diff line number Diff line
@@ -277,29 +277,7 @@ private class NestedDraggableNode(
                }
            }

            var drag = awaitTouchSlopOrCancellation(down.id)

            // We try to pick-up the drag gesture in case the touch slop swipe was consumed by a
            // nested scrollable child that disappeared.
            // This was copied from http://shortn/_10L8U02IoL.
            // TODO(b/380838584): Reuse detect(Horizontal|Vertical)DragGestures() instead.
            while (drag == null && currentEvent.changes.fastAny { it.pressed }) {
                var event: PointerEvent
                do {
                    event = awaitPointerEvent()
                } while (
                    event.changes.fastAny { it.isConsumed } && event.changes.fastAny { it.pressed }
                )

                // An event was not consumed and there's still a pointer in the screen.
                if (event.changes.fastAny { it.pressed }) {
                    // Await touch slop again, using the initial down as starting point.
                    // For most cases this should return immediately since we probably moved
                    // far enough from the initial down event.
                    drag = awaitTouchSlopOrCancellation(down.id)
                }
            }

            val drag = awaitTouchSlopOrCancellation(down.id)
            if (drag != null) {
                velocityTracker.resetTracking()
                val sign = drag.positionChangeIgnoreConsumed().toFloat().sign