Loading packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/MultiPointerDraggable.kt +8 −3 Original line number Diff line number Diff line Loading @@ -234,8 +234,8 @@ internal class MultiPointerDraggableNode( pointersDown == 0 -> { startedPosition = null // This is the last pointer up velocityTracker.addPointerInputChange(changes.single()) val lastPointerUp = changes.single { it.id == velocityPointerId } velocityTracker.addPointerInputChange(lastPointerUp) } // The first pointer down, startedPosition was not set. Loading Loading @@ -271,7 +271,12 @@ internal class MultiPointerDraggableNode( // If the previous pointer has been removed, we use the first available // change to keep tracking the velocity. velocityPointerId = pointerChange.id velocityPointerId = if (pointerChange.pressed) { pointerChange.id } else { changes.first { it.pressed }.id } velocityTracker.addPointerInputChange(pointerChange) } Loading packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/MultiPointerDraggableTest.kt +3 −0 Original line number Diff line number Diff line Loading @@ -438,6 +438,9 @@ class MultiPointerDraggableTest { continueDraggingDown() assertThat(stopped).isTrue() // Complete the gesture rule.onRoot().performTouchInput { up() } } @Test Loading Loading
packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/MultiPointerDraggable.kt +8 −3 Original line number Diff line number Diff line Loading @@ -234,8 +234,8 @@ internal class MultiPointerDraggableNode( pointersDown == 0 -> { startedPosition = null // This is the last pointer up velocityTracker.addPointerInputChange(changes.single()) val lastPointerUp = changes.single { it.id == velocityPointerId } velocityTracker.addPointerInputChange(lastPointerUp) } // The first pointer down, startedPosition was not set. Loading Loading @@ -271,7 +271,12 @@ internal class MultiPointerDraggableNode( // If the previous pointer has been removed, we use the first available // change to keep tracking the velocity. velocityPointerId = pointerChange.id velocityPointerId = if (pointerChange.pressed) { pointerChange.id } else { changes.first { it.pressed }.id } velocityTracker.addPointerInputChange(pointerChange) } Loading
packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/MultiPointerDraggableTest.kt +3 −0 Original line number Diff line number Diff line Loading @@ -438,6 +438,9 @@ class MultiPointerDraggableTest { continueDraggingDown() assertThat(stopped).isTrue() // Complete the gesture rule.onRoot().performTouchInput { up() } } @Test Loading