diff options
| author | Eric Arseneau <earseneau@google.com> | 2021-12-19 22:49:43 -0800 |
|---|---|---|
| committer | Eric Arseneau <earseneau@google.com> | 2021-12-22 12:52:50 -0800 |
| commit | 3e8cb98421761bb7dfafe59a22a15fe2e176f272 (patch) | |
| tree | 754d2b985bde4574c8789e254b120866cf23002a /packages/SystemUI/src/com/android/keyguard/LockIconView.java | |
| parent | 48cbb14e1815430efd7ff5086e7a4c70e75d475f (diff) | |
| parent | 6c2cb6876a30dee0b94d946ca529e06cd96b9642 (diff) | |
Merge s-mpr-2021-12-05
Change-Id: Ic2889f5eb531008340529eadc36ec8efc62b1984
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/LockIconView.java')
| -rw-r--r-- | packages/SystemUI/src/com/android/keyguard/LockIconView.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconView.java b/packages/SystemUI/src/com/android/keyguard/LockIconView.java index 5c34bebdaa4e..ef4353b93179 100644 --- a/packages/SystemUI/src/com/android/keyguard/LockIconView.java +++ b/packages/SystemUI/src/com/android/keyguard/LockIconView.java @@ -27,6 +27,7 @@ import android.widget.FrameLayout; import android.widget.ImageView; import androidx.annotation.NonNull; +import androidx.annotation.VisibleForTesting; import com.android.settingslib.Utils; import com.android.systemui.Dumpable; @@ -47,6 +48,7 @@ public class LockIconView extends FrameLayout implements Dumpable { private ImageView mBgView; private int mLockIconColor; + private boolean mUseBackground = false; public LockIconView(Context context, AttributeSet attrs) { super(context, attrs); @@ -60,8 +62,8 @@ public class LockIconView extends FrameLayout implements Dumpable { mBgView = findViewById(R.id.lock_icon_bg); } - void updateColorAndBackgroundVisibility(boolean useBackground) { - if (useBackground && mLockIcon.getDrawable() != null) { + void updateColorAndBackgroundVisibility() { + if (mUseBackground && mLockIcon.getDrawable() != null) { mLockIconColor = Utils.getColorAttrDefaultColor(getContext(), android.R.attr.textColorPrimary); mBgView.setBackground(getContext().getDrawable(R.drawable.fingerprint_bg)); @@ -77,6 +79,9 @@ public class LockIconView extends FrameLayout implements Dumpable { void setImageDrawable(Drawable drawable) { mLockIcon.setImageDrawable(drawable); + + if (!mUseBackground) return; + if (drawable == null) { mBgView.setVisibility(View.INVISIBLE); } else { @@ -84,6 +89,18 @@ public class LockIconView extends FrameLayout implements Dumpable { } } + /** + * Whether or not to render the lock icon background. Mainly used for UDPFS. + */ + public void setUseBackground(boolean useBackground) { + mUseBackground = useBackground; + updateColorAndBackgroundVisibility(); + } + + /** + * Set the location of the lock icon. + */ + @VisibleForTesting public void setCenterLocation(@NonNull PointF center, int radius) { mLockIconCenter = center; mRadius = radius; |
