summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
diff options
context:
space:
mode:
authorBeverly <beverlyt@google.com>2021-07-08 17:39:51 -0400
committerBeverly <beverlyt@google.com>2021-07-12 13:59:05 -0400
commit035d0290514e9e33b893adb2a921d047ccd52cc7 (patch)
tree2a46693dc5720aca67c668d49f8fa1eae16659c4 /packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
parent01feaca6e2379b774ff9e2b0b3925ca7d2ed11be (diff)
Update lock icon transitions
From fp => unlock and lock => unlock Test: manual Fixes: 192687246 Change-Id: I7e72b30c45112306bd42325ec5c44bb2b50a6870
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/LockIconViewController.java')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/LockIconViewController.java36
1 files changed, 24 insertions, 12 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
index 7bbb63f02f14..afea27222fbb 100644
--- a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
@@ -24,8 +24,8 @@ import android.content.Context;
import android.content.res.Configuration;
import android.graphics.PointF;
import android.graphics.Rect;
+import android.graphics.drawable.AnimatedVectorDrawable;
import android.graphics.drawable.Drawable;
-import android.graphics.drawable.InsetDrawable;
import android.hardware.biometrics.BiometricSourceType;
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
import android.util.DisplayMetrics;
@@ -79,7 +79,8 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
@NonNull private final DelayableExecutor mExecutor;
private boolean mUdfpsEnrolled;
- @NonNull private final Drawable mUnlockIcon;
+ @NonNull private final AnimatedVectorDrawable mFpToUnlockIcon;
+ @NonNull private final AnimatedVectorDrawable mLockToUnlockIcon;
@NonNull private final Drawable mLockIcon;
@NonNull private final CharSequence mUnlockedLabel;
@NonNull private final CharSequence mLockedLabel;
@@ -133,14 +134,14 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
mExecutor = executor;
final Context context = view.getContext();
- mUnlockIcon = new InsetDrawable(context.getResources().getDrawable(
- com.android.internal.R.drawable.ic_lock_open, context.getTheme()),
- context.getResources().getDimensionPixelSize(
- com.android.systemui.R.dimen.udfps_unlock_icon_inset));
- mLockIcon = new InsetDrawable(context.getResources().getDrawable(
- com.android.internal.R.drawable.ic_lock, context.getTheme()),
- context.getResources().getDimensionPixelSize(
- com.android.systemui.R.dimen.udfps_unlock_icon_inset));
+ mLockIcon = mView.getContext().getResources().getDrawable(
+ R.anim.lock_to_unlock,
+ mView.getContext().getTheme());
+ mFpToUnlockIcon = (AnimatedVectorDrawable) mView.getContext().getResources().getDrawable(
+ R.anim.fp_to_unlock, mView.getContext().getTheme());
+ mLockToUnlockIcon = (AnimatedVectorDrawable) mView.getContext().getResources().getDrawable(
+ R.anim.lock_to_unlock,
+ mView.getContext().getTheme());
mUnlockedLabel = context.getResources().getString(R.string.accessibility_unlock_button);
mLockedLabel = context.getResources().getString(R.string.accessibility_lock_icon);
dumpManager.registerDumpable("LockIconViewController", this);
@@ -212,6 +213,8 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
return;
}
+ boolean wasShowingFpIcon = mHasUdfps && !mShowUnlockIcon && !mShowLockIcon;
+ boolean wasShowingLockIcon = mShowLockIcon;
mShowLockIcon = !mCanDismissLockScreen && !mUserUnlockedWithBiometric && isLockScreen()
&& (!mUdfpsEnrolled || !mRunningFPS);
mShowUnlockIcon = mCanDismissLockScreen && isLockScreen();
@@ -222,7 +225,15 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
mView.setVisibility(View.VISIBLE);
mView.setContentDescription(mLockedLabel);
} else if (mShowUnlockIcon) {
- mView.setImageDrawable(mUnlockIcon);
+ if (wasShowingFpIcon) {
+ mView.setImageDrawable(mFpToUnlockIcon);
+ mFpToUnlockIcon.forceAnimationOnUI();
+ mFpToUnlockIcon.start();
+ } else if (wasShowingLockIcon) {
+ mView.setImageDrawable(mLockToUnlockIcon);
+ mLockToUnlockIcon.forceAnimationOnUI();
+ mLockToUnlockIcon.start();
+ }
mView.setVisibility(View.VISIBLE);
mView.setContentDescription(mUnlockedLabel);
} else {
@@ -272,7 +283,8 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
private void updateColors() {
final int color = Utils.getColorAttrDefaultColor(mView.getContext(),
R.attr.wallpaperTextColorAccent);
- mUnlockIcon.setTint(color);
+ mFpToUnlockIcon.setTint(color);
+ mLockToUnlockIcon.setTint(color);
mLockIcon.setTint(color);
}