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

Commit 7f781cc1 authored by Miranda Kephart's avatar Miranda Kephart
Browse files

Set screenshot preview animation destination explicitly

Set the scale/position parameters when the animation ends to ensure the
preview ends up in the right place even if the animation is cancelled.

Bug: 332410356
Test: manual (take screenshots in quick succession, verify preview is in
the right place at end of animation)
Flag: ACONFIG com.android.systemui.screenshot_shelf_ui2 TEAMFOOD

Change-Id: I00d36a8acbf1ecd70014c19bdbd0a8c4c1ecf90d
parent 632c60d9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -155,6 +155,12 @@ class ScreenshotAnimationController(private val view: ScreenshotShelfView) {

        val previewAnimator = AnimatorSet()
        previewAnimator.play(previewXAndScaleAnimator).with(previewYAnimator)
        previewAnimator.doOnEnd {
            screenshotPreview.scaleX = 1f
            screenshotPreview.scaleY = 1f
            screenshotPreview.x = endPos.x - screenshotPreview.width / 2f
            screenshotPreview.y = endPos.y - screenshotPreview.height / 2f
        }

        previewAnimator.doOnStart { screenshotPreview.visibility = View.VISIBLE }
        return previewAnimator