summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/keyguard/NumPadButton.java
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/NumPadButton.java')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/NumPadButton.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/NumPadButton.java b/packages/SystemUI/src/com/android/keyguard/NumPadButton.java
index 57407f1f34c0..f4ce643a085c 100644
--- a/packages/SystemUI/src/com/android/keyguard/NumPadButton.java
+++ b/packages/SystemUI/src/com/android/keyguard/NumPadButton.java
@@ -18,6 +18,7 @@ package com.android.keyguard;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
+import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.RippleDrawable;
import android.graphics.drawable.VectorDrawable;
@@ -26,8 +27,6 @@ import android.view.MotionEvent;
import androidx.annotation.Nullable;
-import com.android.settingslib.Utils;
-
/**
* Similar to the {@link NumPadKey}, but displays an image.
*/
@@ -59,7 +58,9 @@ public class NumPadButton extends AlphaOptimizedImageButton {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
// Set width/height to the same value to ensure a smooth circle for the bg, but shrink
- // the height to match the old pin bouncer
+ // the height to match the old pin bouncer.
+ // This is only used for PIN/PUK; the main PIN pad now uses ConstraintLayout, which will
+ // force our width/height to conform to the ratio in the layout.
int width = getMeasuredWidth();
boolean shortenHeight = mAnimator == null
@@ -90,8 +91,10 @@ public class NumPadButton extends AlphaOptimizedImageButton {
public void reloadColors() {
if (mAnimator != null) mAnimator.reloadColors(getContext());
- int textColor = Utils.getColorAttrDefaultColor(getContext(),
- android.R.attr.colorBackground);
- ((VectorDrawable) getDrawable()).setTintList(ColorStateList.valueOf(textColor));
+ int[] customAttrs = {android.R.attr.textColorPrimaryInverse};
+ TypedArray a = getContext().obtainStyledAttributes(customAttrs);
+ int imageColor = a.getColor(0, 0);
+ a.recycle();
+ ((VectorDrawable) getDrawable()).setTintList(ColorStateList.valueOf(imageColor));
}
}