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

Commit 32f22de9 authored by Ats Jenk's avatar Ats Jenk Committed by Android (Google) Code Review
Browse files

Merge "Reuse stash handle alpha animation constants" into main

parents e6eca9c1 673b8853
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
@@ -285,8 +285,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)