summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2019-03-15 07:02:23 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-03-15 07:02:23 +0000
commita3e9de112196e86bbafd36d70983fa7981f39295 (patch)
tree3c0df85292c6e1f89bb2ba84dfbc8b4a4ce60644
parentac31dd3a6d7bba22f9dee1533fe54430c2ec7012 (diff)
parentf3b26292efc51be58497b8a850d010f9a22ebd27 (diff)
Merge "Let scanning progress loop"
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
index df3a66b18381..27394d92d672 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
@@ -21,6 +21,7 @@ import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.PorterDuff;
+import android.graphics.drawable.Animatable2;
import android.graphics.drawable.AnimatedVectorDrawable;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
@@ -134,6 +135,16 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
if (animation != null && isAnim) {
animation.forceAnimationOnUI();
+ animation.clearAnimationCallbacks();
+ animation.registerAnimationCallback(new Animatable2.AnimationCallback() {
+ @Override
+ public void onAnimationEnd(Drawable drawable) {
+ if (getDrawable() == animation && state == getState()
+ && doesAnimationLoop(iconAnimRes)) {
+ animation.start();
+ }
+ }
+ });
animation.start();
}
@@ -215,6 +226,10 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
return mContext.getDrawable(iconRes);
}
+ private boolean doesAnimationLoop(int resourceId) {
+ return resourceId == com.android.internal.R.anim.lock_scanning;
+ }
+
private static int getAnimationResForTransition(int oldState, int newState,
boolean wasPulsing, boolean pulsing,
boolean wasDozing, boolean dozing) {