Merge "Update stepped clock animation to use real specs." into tm-qpr-dev am: 3d100cf87c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20508608

Change-Id: I91ed957a6c181914deef5d4a3122779c73590e41
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jamie Garside
2022-11-18 14:20:20 +00:00
committed by Automerger Merge Worker
2 changed files with 11 additions and 3 deletions

View File

@@ -613,7 +613,7 @@ class AnimatableClockView @JvmOverloads constructor(
private const val CHARGE_ANIM_DURATION_PHASE_1: Long = 1000 private const val CHARGE_ANIM_DURATION_PHASE_1: Long = 1000
// Constants for the animation // Constants for the animation
private val MOVE_INTERPOLATOR = Interpolators.STANDARD private val MOVE_INTERPOLATOR = Interpolators.EMPHASIZED
// Calculate the positions of all of the digits... // Calculate the positions of all of the digits...
// Offset each digit by, say, 0.1 // 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" // 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 // (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). // 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 // 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. // 0.1, then digit 0 would animate over 0.0 - 0.7, making availableTime 0.7.

View File

@@ -279,6 +279,11 @@ public final class NotificationPanelViewController implements Dumpable {
private static final String COUNTER_PANEL_OPEN_PEEK = "panel_open_peek"; 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 M_DUMMY_DIRTY_RECT = new Rect(0, 0, 1, 1);
private static final Rect EMPTY_RECT = new Rect(); 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 StatusBarTouchableRegionManager mStatusBarTouchableRegionManager;
private final Resources mResources; 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. // Use linear here, so the actual clock can pick its own interpolator.
adapter.setInterpolator(Interpolators.LINEAR); adapter.setInterpolator(Interpolators.LINEAR);
adapter.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD); adapter.setDuration(KEYGUARD_STATUS_VIEW_CUSTOM_CLOCK_MOVE_DURATION);
adapter.addTarget(clockView); adapter.addTarget(clockView);
set.addTransition(adapter); set.addTransition(adapter);