Loading packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/MultiPointerDraggable.kt +8 −14 Original line number Diff line number Diff line Loading @@ -200,7 +200,7 @@ internal class MultiPointerDraggableNode( override fun onPointerEvent( pointerEvent: PointerEvent, pass: PointerEventPass, bounds: IntSize bounds: IntSize, ) { // The order is important here: the tracker is always called first. pointerTracker.onPointerEvent(pointerEvent, pass, bounds) Loading Loading @@ -312,13 +312,13 @@ internal class MultiPointerDraggableNode( velocityTracker.calculateVelocity(maxVelocity) } .toFloat(), onFling = { controller.onStop(it, canChangeContent = true) } onFling = { controller.onStop(it, canChangeContent = true) }, ) }, onDragCancel = { controller -> startFlingGesture( initialVelocity = 0f, onFling = { controller.onStop(it, canChangeContent = true) } onFling = { controller.onStop(it, canChangeContent = true) }, ) }, swipeDetector = swipeDetector, Loading Loading @@ -369,10 +369,7 @@ internal class MultiPointerDraggableNode( // PreScroll phase val consumedByPreScroll = dispatcher .dispatchPreScroll( available = availableOnPreScroll.toOffset(), source = source, ) .dispatchPreScroll(available = availableOnPreScroll.toOffset(), source = source) .toFloat() // Scroll phase Loading Loading @@ -484,12 +481,12 @@ internal class MultiPointerDraggableNode( Orientation.Horizontal -> awaitHorizontalTouchSlopOrCancellation( consumablePointer.id, onSlopReached onSlopReached, ) Orientation.Vertical -> awaitVerticalTouchSlopOrCancellation( consumablePointer.id, onSlopReached onSlopReached, ) } Loading Loading @@ -553,7 +550,7 @@ internal class MultiPointerDraggableNode( } private suspend fun AwaitPointerEventScope.awaitConsumableEvent( pass: () -> PointerEventPass, pass: () -> PointerEventPass ): PointerEvent { fun canBeConsumed(changes: List<PointerInputChange>): Boolean { // At least one pointer down AND Loading Loading @@ -661,7 +658,4 @@ internal fun interface PointersInfoOwner { fun pointersInfo(): PointersInfo } internal data class PointersInfo( val startedPosition: Offset?, val pointersDown: Int, ) internal data class PointersInfo(val startedPosition: Offset?, val pointersDown: Int) packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/MultiPointerDraggableTest.kt +3 −3 Original line number Diff line number Diff line Loading @@ -259,7 +259,7 @@ class MultiPointerDraggableTest { it } ), Orientation.Vertical Orientation.Vertical, ) .fillMaxSize() ) Loading Loading @@ -640,7 +640,7 @@ class MultiPointerDraggableTest { override fun onPostScroll( consumed: Offset, available: Offset, source: NestedScrollSource source: NestedScrollSource, ): Offset { availableOnPostScroll = available.y return Offset.Zero Loading @@ -653,7 +653,7 @@ class MultiPointerDraggableTest { override suspend fun onPostFling( consumed: Velocity, available: Velocity available: Velocity, ): Velocity { availableOnPostFling = available.y return Velocity.Zero Loading Loading
packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/MultiPointerDraggable.kt +8 −14 Original line number Diff line number Diff line Loading @@ -200,7 +200,7 @@ internal class MultiPointerDraggableNode( override fun onPointerEvent( pointerEvent: PointerEvent, pass: PointerEventPass, bounds: IntSize bounds: IntSize, ) { // The order is important here: the tracker is always called first. pointerTracker.onPointerEvent(pointerEvent, pass, bounds) Loading Loading @@ -312,13 +312,13 @@ internal class MultiPointerDraggableNode( velocityTracker.calculateVelocity(maxVelocity) } .toFloat(), onFling = { controller.onStop(it, canChangeContent = true) } onFling = { controller.onStop(it, canChangeContent = true) }, ) }, onDragCancel = { controller -> startFlingGesture( initialVelocity = 0f, onFling = { controller.onStop(it, canChangeContent = true) } onFling = { controller.onStop(it, canChangeContent = true) }, ) }, swipeDetector = swipeDetector, Loading Loading @@ -369,10 +369,7 @@ internal class MultiPointerDraggableNode( // PreScroll phase val consumedByPreScroll = dispatcher .dispatchPreScroll( available = availableOnPreScroll.toOffset(), source = source, ) .dispatchPreScroll(available = availableOnPreScroll.toOffset(), source = source) .toFloat() // Scroll phase Loading Loading @@ -484,12 +481,12 @@ internal class MultiPointerDraggableNode( Orientation.Horizontal -> awaitHorizontalTouchSlopOrCancellation( consumablePointer.id, onSlopReached onSlopReached, ) Orientation.Vertical -> awaitVerticalTouchSlopOrCancellation( consumablePointer.id, onSlopReached onSlopReached, ) } Loading Loading @@ -553,7 +550,7 @@ internal class MultiPointerDraggableNode( } private suspend fun AwaitPointerEventScope.awaitConsumableEvent( pass: () -> PointerEventPass, pass: () -> PointerEventPass ): PointerEvent { fun canBeConsumed(changes: List<PointerInputChange>): Boolean { // At least one pointer down AND Loading Loading @@ -661,7 +658,4 @@ internal fun interface PointersInfoOwner { fun pointersInfo(): PointersInfo } internal data class PointersInfo( val startedPosition: Offset?, val pointersDown: Int, ) internal data class PointersInfo(val startedPosition: Offset?, val pointersDown: Int)
packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/MultiPointerDraggableTest.kt +3 −3 Original line number Diff line number Diff line Loading @@ -259,7 +259,7 @@ class MultiPointerDraggableTest { it } ), Orientation.Vertical Orientation.Vertical, ) .fillMaxSize() ) Loading Loading @@ -640,7 +640,7 @@ class MultiPointerDraggableTest { override fun onPostScroll( consumed: Offset, available: Offset, source: NestedScrollSource source: NestedScrollSource, ): Offset { availableOnPostScroll = available.y return Offset.Zero Loading @@ -653,7 +653,7 @@ class MultiPointerDraggableTest { override suspend fun onPostFling( consumed: Velocity, available: Velocity available: Velocity, ): Velocity { availableOnPostFling = available.y return Velocity.Zero Loading