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

Commit 486822e9 authored by Anvesh Renikindi (xWF)'s avatar Anvesh Renikindi (xWF) Committed by Android (Google) Code Review
Browse files

Merge "Fixed errors after updated ag/29186008" into main

parents 4351a51a f39dfee1
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -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.
@@ -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)
                    }
+3 −0
Original line number Diff line number Diff line
@@ -438,6 +438,9 @@ class MultiPointerDraggableTest {

        continueDraggingDown()
        assertThat(stopped).isTrue()

        // Complete the gesture
        rule.onRoot().performTouchInput { up() }
    }

    @Test