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

Commit 673b8853 authored by Ats Jenk's avatar Ats Jenk
Browse files

Reuse stash handle alpha animation constants

Taskbar and bubble bar stash handle should use a similar animation for
stash and unstash.
Remove duplicate alpha animation constants and use only the ones defined
in taskbar controller for taskbar and bubble bar.

Bug: 345680453
Flag: EXEMPT refactor
Test: m
Change-Id: I9edf847fc4148bc731051de60a883011e6bfb848
parent dff855e7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -152,12 +152,12 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
    /**
     * How long to delay the icon/stash handle alpha.
     */
    private static final long TASKBAR_STASH_ALPHA_START_DELAY = 33;
    public static final long TASKBAR_STASH_ALPHA_START_DELAY = 33;

    /**
     * How long the icon/stash handle alpha animation plays.
     */
    private static final long TASKBAR_STASH_ALPHA_DURATION = 50;
    public static final long TASKBAR_STASH_ALPHA_DURATION = 50;

    /**
     * How long to delay the icon/stash handle alpha for the home to app taskbar animation.
+0 −3
Original line number Diff line number Diff line
@@ -179,9 +179,6 @@ interface BubbleStashController {
        /** How long to stash/unstash. */
        const val BAR_STASH_DURATION = InsetsController.ANIMATION_DURATION_RESIZE.toLong()

        const val BAR_STASH_ALPHA_DURATION = 50L
        const val BAR_STASH_ALPHA_DELAY = 33L

        /** How long to translate Y coordinate of the BubbleBar. */
        const val BAR_TRANSLATION_DURATION = 300L
    }
+4 −4
Original line number Diff line number Diff line
@@ -31,10 +31,10 @@ import com.android.launcher3.R
import com.android.launcher3.anim.AnimatedFloat
import com.android.launcher3.anim.SpringAnimationBuilder
import com.android.launcher3.taskbar.TaskbarInsetsController
import com.android.launcher3.taskbar.TaskbarStashController.TASKBAR_STASH_ALPHA_DURATION
import com.android.launcher3.taskbar.TaskbarStashController.TASKBAR_STASH_ALPHA_START_DELAY
import com.android.launcher3.taskbar.bubbles.BubbleBarViewController
import com.android.launcher3.taskbar.bubbles.BubbleStashedHandleViewController
import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.Companion.BAR_STASH_ALPHA_DELAY
import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.Companion.BAR_STASH_ALPHA_DURATION
import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.Companion.BAR_STASH_DURATION
import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.Companion.BAR_TRANSLATION_DURATION
import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.ControllersAfterInitAction
@@ -274,8 +274,8 @@ class TransientBubbleStashController(
    private fun createStashAnimator(isStashed: Boolean, duration: Long): AnimatorSet {
        val animatorSet = AnimatorSet()

        val alphaDuration = if (isStashed) duration else BAR_STASH_ALPHA_DURATION
        val alphaDelay = if (isStashed) BAR_STASH_ALPHA_DELAY else 0L
        val alphaDuration = if (isStashed) duration else TASKBAR_STASH_ALPHA_DURATION
        val alphaDelay = if (isStashed) TASKBAR_STASH_ALPHA_START_DELAY else 0L
        animatorSet.play(
            createStashAlphaAnimator(isStashed).apply {
                this.duration = max(0L, alphaDuration - alphaDelay)