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

Commit cc71d7fe authored by mattsziklay's avatar mattsziklay
Browse files

Fix Manage Windows alpha animation.

Sets initial alpha of icon views to 0. This prevents an animation bug
where icons would fully show, jump to 0 alpha, then animate to full.

Additionally, correctly applies delay to icon view alpha animation,
starting it slightly after the base view's animator.

Bug: 439604183
Test: Manual
Flag: EXEMPT, minor change
Change-Id: I97861f712b2072a6b0184a1d5a13bc6e538326e4
parent b65abf84
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -133,6 +133,7 @@ abstract class ManageWindowsViewContainer(
                null
            )
            menuBackground.paint.color = menuBackgroundColor
            scrollableMenuView.alpha = 0f
            scrollableMenuView.background = menuBackground
            scrollableMenuView.elevation = getDimensionPixelSize(MENU_ELEVATION_DP)
            scrollableMenuView.setOnTouchListener { _, event ->
@@ -203,6 +204,7 @@ abstract class ManageWindowsViewContainer(
                    menuWidth += (instanceIconWidth + iconMargin).toInt()
                }
                rowLayout?.addView(appSnapshotButton)
                appSnapshotButton.alpha = 0f
                iconViews += appSnapshotButton
                appSnapshotButton.requestLayout()
                rowLayout?.post {
@@ -254,7 +256,7 @@ abstract class ManageWindowsViewContainer(
            )
            for (view in iconViews) {
                animateView(view, MENU_BOUNDS_SHRUNK_SCALE, MENU_BOUNDS_FULL_SCALE,
                    MENU_START_ALPHA, MENU_FULL_ALPHA
                    MENU_START_ALPHA, MENU_FULL_ALPHA, delay = MENU_ALPHA_ANIM_DELAY
                )
            }
            createAnimatorSet().start()
@@ -267,7 +269,7 @@ abstract class ManageWindowsViewContainer(
            )
            for (view in iconViews) {
                animateView(view, MENU_BOUNDS_FULL_SCALE, MENU_BOUNDS_SHRUNK_SCALE,
                    MENU_FULL_ALPHA, MENU_START_ALPHA
                    MENU_FULL_ALPHA, MENU_START_ALPHA, delay = MENU_ALPHA_ANIM_DELAY
                )
            }
            createAnimatorSet().apply {
@@ -287,7 +289,9 @@ abstract class ManageWindowsViewContainer(
            startBoundsScale: Float,
            endBoundsScale: Float,
            startAlpha: Float,
            endAlpha: Float) {
            endAlpha: Float,
            delay: Long = 0
        ) {
            animators += ObjectAnimator.ofFloat(
                view,
                SCALE_X,
@@ -311,7 +315,7 @@ abstract class ManageWindowsViewContainer(
                endAlpha
            ).apply {
                duration = MENU_ALPHA_ANIM_DURATION
                startDelay = MENU_ALPHA_ANIM_DELAY
                startDelay = delay
            }
        }