summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
diff options
context:
space:
mode:
authorMatt Pietal <mpietal@google.com>2020-11-03 15:11:20 -0500
committerMatt Pietal <mpietal@google.com>2020-11-04 09:12:50 -0500
commit6a350b53cff91e8b3bc27aa28aaab4d2603d1d84 (patch)
tree9b3dc8d786c276a18fbd988d10c9e126b18c07a5 /packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
parent94b76b2267b20c5e56d4f50c4e259ecf3c984150 (diff)
AOD - Burn in adjustments
Move both the clock and keyguard slice area towards the middle for x adjustments, and retain the current Y adjustments. Bug: 172360102 Test: follow burn in instructions here: /frameworks/base/packages/SystemUI/docs/clock-plugins.md Change-Id: Id22d777724bf9be58758b1a2b260a7933af8e999
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
index 628193dc305d..5b89f7f46772 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
@@ -22,6 +22,7 @@ import android.text.format.DateFormat;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.FrameLayout;
import com.android.internal.colorextraction.ColorExtractor;
import com.android.keyguard.clock.ClockManager;
@@ -30,6 +31,9 @@ import com.android.systemui.colorextraction.SysuiColorExtractor;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.plugins.ClockPlugin;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
+import com.android.systemui.statusbar.notification.AnimatableProperty;
+import com.android.systemui.statusbar.notification.PropertyAnimator;
+import com.android.systemui.statusbar.notification.stack.AnimationProperties;
import com.android.systemui.statusbar.phone.NotificationIconAreaController;
import com.android.systemui.statusbar.phone.NotificationIconContainer;
import com.android.systemui.util.ViewController;
@@ -51,6 +55,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
private final ClockManager mClockManager;
private final KeyguardSliceViewController mKeyguardSliceViewController;
private final NotificationIconAreaController mNotificationIconAreaController;
+ private FrameLayout mNewLockscreenClockFrame;
private int mLockScreenMode = KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL;
@@ -114,6 +119,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
mColorExtractor.addOnColorsChangedListener(mColorsListener);
mView.updateColors(getGradientColors());
updateAodIcons();
+ mNewLockscreenClockFrame = mView.findViewById(R.id.new_lockscreen_clock_view);
}
@Override
@@ -180,6 +186,21 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
}
/**
+ * Update position of the view, with optional animation. Move the slice view and the clock
+ * slightly towards the center in order to prevent burn-in. Y positioning occurs at the
+ * view parent level.
+ */
+ void updatePosition(int x, AnimationProperties props, boolean animate) {
+ x = Math.abs(x);
+ if (mNewLockscreenClockFrame != null) {
+ PropertyAnimator.setProperty(mNewLockscreenClockFrame, AnimatableProperty.TRANSLATION_X,
+ -x, props, animate);
+ }
+ mKeyguardSliceViewController.updatePosition(x, props, animate);
+ mNotificationIconAreaController.updatePosition(x, props, animate);
+ }
+
+ /**
* Update lockscreen mode that may change clock display.
*/
void updateLockScreenMode(int mode) {