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

Commit 64190586 authored by Jordan Demeulenaere's avatar Jordan Demeulenaere
Browse files

Remove unused and untested DraggableHandler code

This CL removes code that is used when previewing a scene transition. I
am not sure why it was there but removing it does not make any test fail
and the preview case of the demo still works as expected, so let's
remove it.

Bug: 353679003
Test: atest PlatformComposeSceneTransitionLayoutTests
Flag: com.android.systemui.scene_container
Change-Id: If0ac070cd22e10012e4fd919a0e4cfd20bc07e7b
parent b1003425
Loading
Loading
Loading
Loading
+4 −31
Original line number Diff line number Diff line
@@ -459,38 +459,11 @@ private class DragControllerImpl(

            animateTo(targetScene = targetScene, targetOffset = targetOffset)
        } else {
            // We are doing an overscroll animation between scenes. In this case, we can also start
            // from the idle position.

            val startFromIdlePosition = swipeTransition.dragOffset == 0f

            if (startFromIdlePosition) {
                // If there is a target scene, we start the overscroll animation.
                val result = swipes.findUserActionResultStrict(velocity)
                if (result == null) {
                    // We will not animate
                    swipeTransition.snapToScene(fromScene.key)
                    return 0f
            // We are doing an overscroll preview animation between scenes.
            check(fromScene == swipeTransition._currentScene) {
                "canChangeScene is false but currentScene != fromScene"
            }

                val newSwipeTransition =
                    SwipeTransition(
                            layoutState = layoutState,
                            coroutineScope = draggableHandler.coroutineScope,
                            fromScene = fromScene,
                            result = result,
                            swipes = swipes,
                            layoutImpl = draggableHandler.layoutImpl,
                            orientation = draggableHandler.orientation,
                        )
                        .apply { _currentScene = swipeTransition._currentScene }

                updateTransition(newSwipeTransition)
            animateTo(targetScene = fromScene, targetOffset = 0f)
            } else {
                // We were between two scenes: animate to the initial scene.
                animateTo(targetScene = fromScene, targetOffset = 0f)
            }
        }

        // The onStop animation consumes any remaining velocity.