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

Commit b761914b authored by Jamie Garside's avatar Jamie Garside
Browse files

Update stepped clock animation to use real specs.

This updates a couple of things:

* Overall clock animation time is 1000ms now.
* Interpolator for clock digits changed to EMPHASIZED.
* Each digit now has a 33ms delay between them.

Bug: 199051139
Test: Manually verified.
Change-Id: I3f2480822827bd9e08aeadb922e6c81c29947cfe
parent e5e9f65a
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -613,7 +613,7 @@ class AnimatableClockView @JvmOverloads constructor(
        private const val CHARGE_ANIM_DURATION_PHASE_1: Long = 1000

        // Constants for the animation
        private val MOVE_INTERPOLATOR = Interpolators.STANDARD
        private val MOVE_INTERPOLATOR = Interpolators.EMPHASIZED

        // Calculate the positions of all of the digits...
        // Offset each digit by, say, 0.1
@@ -637,7 +637,10 @@ class AnimatableClockView @JvmOverloads constructor(
        // How much delay to apply to each subsequent digit. This is measured in terms of "fraction"
        // (i.e. a value of 0.1 would cause a digit to wait until fraction had hit 0.1, or 0.2 etc
        // before moving).
        private const val MOVE_DIGIT_STEP = 0.1f
        //
        // The current specs dictate that each digit should have a 33ms gap between them. The
        // overall time is 1s right now.
        private const val MOVE_DIGIT_STEP = 0.033f

        // Total available transition time for each digit, taking into account the step. If step is
        // 0.1, then digit 0 would animate over 0.0 - 0.7, making availableTime 0.7.
+6 −1
Original line number Diff line number Diff line
@@ -279,6 +279,11 @@ public final class NotificationPanelViewController implements Dumpable {
    private static final String COUNTER_PANEL_OPEN_PEEK = "panel_open_peek";
    private static final Rect M_DUMMY_DIRTY_RECT = new Rect(0, 0, 1, 1);
    private static final Rect EMPTY_RECT = new Rect();
    /**
     * Duration to use for the animator when the keyguard status view alignment changes, and a
     * custom clock animation is in use.
     */
    private static final int KEYGUARD_STATUS_VIEW_CUSTOM_CLOCK_MOVE_DURATION = 1000;

    private final StatusBarTouchableRegionManager mStatusBarTouchableRegionManager;
    private final Resources mResources;
@@ -1592,7 +1597,7 @@ public final class NotificationPanelViewController implements Dumpable {

                        // Use linear here, so the actual clock can pick its own interpolator.
                        adapter.setInterpolator(Interpolators.LINEAR);
                        adapter.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD);
                        adapter.setDuration(KEYGUARD_STATUS_VIEW_CUSTOM_CLOCK_MOVE_DURATION);
                        adapter.addTarget(clockView);
                        set.addTransition(adapter);