summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java22
1 files changed, 19 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
index 41df196c62b0..6da143c0e083 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
@@ -28,7 +28,7 @@ import android.os.Handler;
import android.os.Looper;
import android.os.RemoteException;
import android.os.UserHandle;
-import android.support.v4.graphics.ColorUtils;
+import androidx.core.graphics.ColorUtils;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.util.ArraySet;
@@ -73,6 +73,7 @@ public class KeyguardStatusView extends GridLayout implements
private ArraySet<View> mVisibleInDoze;
private boolean mPulsing;
+ private boolean mWasPulsing;
private float mDarkAmount = 0;
private int mTextColor;
private float mWidgetPadding;
@@ -198,6 +199,9 @@ public class KeyguardStatusView extends GridLayout implements
mClockView.setElegantTextHeight(false);
}
+ /**
+ * Moves clock and separator, adjusting margins when slice content changes.
+ */
private void onSliceContentChanged() {
boolean smallClock = mKeyguardSlice.hasHeader() || mPulsing;
float clockScale = smallClock ? mSmallClockScale : 1;
@@ -220,11 +224,12 @@ public class KeyguardStatusView extends GridLayout implements
@Override
public void onLayoutChange(View view, int left, int top, int right, int bottom,
int oldLeft, int oldTop, int oldRight, int oldBottom) {
- int heightOffset = mPulsing ? 0 : getHeight() - mLastLayoutHeight;
+ int heightOffset = mPulsing || mWasPulsing ? 0 : getHeight() - mLastLayoutHeight;
boolean hasHeader = mKeyguardSlice.hasHeader();
boolean smallClock = hasHeader || mPulsing;
long duration = KeyguardSliceView.DEFAULT_ANIM_DURATION;
- long delay = smallClock ? 0 : duration / 4;
+ long delay = smallClock || mWasPulsing ? 0 : duration / 4;
+ mWasPulsing = false;
boolean shouldAnimate = mKeyguardSlice.getLayoutTransition() != null
&& mKeyguardSlice.getLayoutTransition().isRunning();
@@ -448,7 +453,18 @@ public class KeyguardStatusView extends GridLayout implements
}
public void setPulsing(boolean pulsing, boolean animate) {
+ if (mPulsing == pulsing) {
+ return;
+ }
+ if (mPulsing) {
+ mWasPulsing = true;
+ }
mPulsing = pulsing;
+ // Animation can look really weird when the slice has a header, let's hide the views
+ // immediately instead of fading them away.
+ if (mKeyguardSlice.hasHeader()) {
+ animate = false;
+ }
mKeyguardSlice.setPulsing(pulsing, animate);
updateDozeVisibleViews();
}