summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/res-keyguard/drawable/ic_backspace_24dp.xml (renamed from packages/SystemUI/res-keyguard/drawable/ic_backspace_black_24dp.xml)4
-rw-r--r--packages/SystemUI/res-keyguard/drawable/num_pad_key_background.xml25
-rw-r--r--packages/SystemUI/res-keyguard/values/dimens.xml2
-rw-r--r--packages/SystemUI/res-keyguard/values/styles.xml5
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java6
-rw-r--r--packages/SystemUI/src/com/android/keyguard/NumPadAnimator.java29
-rw-r--r--packages/SystemUI/src/com/android/keyguard/NumPadButton.java4
-rw-r--r--packages/SystemUI/src/com/android/keyguard/NumPadKey.java4
8 files changed, 48 insertions, 31 deletions
diff --git a/packages/SystemUI/res-keyguard/drawable/ic_backspace_black_24dp.xml b/packages/SystemUI/res-keyguard/drawable/ic_backspace_24dp.xml
index 1f6b24bb85bf..dd35dd91f5d6 100644
--- a/packages/SystemUI/res-keyguard/drawable/ic_backspace_black_24dp.xml
+++ b/packages/SystemUI/res-keyguard/drawable/ic_backspace_24dp.xml
@@ -1,5 +1,5 @@
<!--
- ~ Copyright (C) 2017 The Android Open Source Project
+ ~ Copyright (C) 2021 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@@ -20,6 +20,6 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
- android:fillColor="#FF000000"
+ android:fillColor="?android:attr/colorBackground"
android:pathData="M9,15.59L12.59,12L9,8.41L10.41,7L14,10.59L17.59,7L19,8.41L15.41,12L19,15.59L17.59,17L14,13.41L10.41,17L9,15.59zM21,6H8l-4.5,6L8,18h13V6M21,4c1.1,0 2,0.9 2,2v12c0,1.1 -0.9,2 -2,2H8c-0.63,0 -1.22,-0.3 -1.6,-0.8L1,12l5.4,-7.2C6.78,4.3 7.37,4 8,4H21L21,4z"/>
</vector>
diff --git a/packages/SystemUI/res-keyguard/drawable/num_pad_key_background.xml b/packages/SystemUI/res-keyguard/drawable/num_pad_key_background.xml
index b7a9fafd0c44..604ab723da90 100644
--- a/packages/SystemUI/res-keyguard/drawable/num_pad_key_background.xml
+++ b/packages/SystemUI/res-keyguard/drawable/num_pad_key_background.xml
@@ -16,8 +16,23 @@
* limitations under the License.
*/
-->
-<shape
- xmlns:android="http://schemas.android.com/apk/res/android">
- <solid android:color="?android:attr/colorBackground" />
- <corners android:radius="10dp" />
-</shape>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@+id/background">
+ <shape>
+ <solid android:color="?android:attr/colorControlNormal" />
+ <corners android:radius="10dp" />
+ </shape>
+ </item>
+ <item android:id="@+id/ripple">
+ <ripple
+ android:color="?android:attr/colorControlHighlight">
+ <item android:id="@android:id/mask">
+ <shape android:shape="rectangle">
+ <solid android:color="?android:attr/colorControlNormal" />
+ <corners android:radius="10dp" />
+ </shape>
+ </item>
+ </ripple>
+ </item>
+</layer-list>
+
diff --git a/packages/SystemUI/res-keyguard/values/dimens.xml b/packages/SystemUI/res-keyguard/values/dimens.xml
index a928b759e1b8..2a5784a1e6e9 100644
--- a/packages/SystemUI/res-keyguard/values/dimens.xml
+++ b/packages/SystemUI/res-keyguard/values/dimens.xml
@@ -40,7 +40,7 @@
<dimen name="keyguard_security_view_top_margin">8dp</dimen>
<dimen name="keyguard_security_view_lateral_margin">36dp</dimen>
- <dimen name="keyguard_eca_top_margin">24dp</dimen>
+ <dimen name="keyguard_eca_top_margin">18dp</dimen>
<!-- EmergencyCarrierArea overlap - amount to overlap the emergency button and carrier text.
Should be 0 on devices with plenty of room (e.g. tablets) -->
diff --git a/packages/SystemUI/res-keyguard/values/styles.xml b/packages/SystemUI/res-keyguard/values/styles.xml
index cd82b805be9c..2391803957e5 100644
--- a/packages/SystemUI/res-keyguard/values/styles.xml
+++ b/packages/SystemUI/res-keyguard/values/styles.xml
@@ -52,9 +52,8 @@
<item name="android:textColor">?android:attr/textColorPrimary</item>
</style>
<style name="NumPadKey.Delete">
- <item name="android:src">@drawable/ic_backspace_black_24dp</item>
- <item name="android:tint">?android:attr/textColorSecondary</item>
- <item name="android:tintMode">src_in</item>
+ <item name="android:colorControlNormal">?android:attr/textColorSecondary</item>
+ <item name="android:src">@drawable/ic_backspace_24dp</item>
</style>
<style name="NumPadKey.Enter">
<item name="android:colorControlNormal">?android:attr/textColorSecondary</item>
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java
index 825ea2570df0..4e06491621cb 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java
@@ -24,14 +24,12 @@ import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_TIMEOUT;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_USER_REQUEST;
import android.content.Context;
-import android.content.res.ColorStateList;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.View;
import com.android.internal.widget.LockscreenCredential;
-import com.android.settingslib.Utils;
import com.android.systemui.R;
/**
@@ -188,10 +186,6 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView
key.reloadColors();
}
mPasswordEntry.reloadColors();
- int deleteColor = Utils.getColorAttr(getContext(), android.R.attr.textColorSecondary)
- .getDefaultColor();
- mDeleteButton.setImageTintList(ColorStateList.valueOf(deleteColor));
-
mDeleteButton.reloadColors();
mOkButton.reloadColors();
}
diff --git a/packages/SystemUI/src/com/android/keyguard/NumPadAnimator.java b/packages/SystemUI/src/com/android/keyguard/NumPadAnimator.java
index cdf98581e29b..97d6e9750716 100644
--- a/packages/SystemUI/src/com/android/keyguard/NumPadAnimator.java
+++ b/packages/SystemUI/src/com/android/keyguard/NumPadAnimator.java
@@ -17,14 +17,16 @@ package com.android.keyguard;
import android.animation.ValueAnimator;
import android.content.Context;
+import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.drawable.GradientDrawable;
+import android.graphics.drawable.LayerDrawable;
+import android.graphics.drawable.RippleDrawable;
import android.view.ContextThemeWrapper;
import android.view.ViewGroup;
import androidx.annotation.StyleRes;
-import com.android.internal.graphics.ColorUtils;
import com.android.systemui.Interpolators;
import com.android.systemui.R;
@@ -34,13 +36,18 @@ import com.android.systemui.R;
class NumPadAnimator {
private ValueAnimator mAnimator;
private GradientDrawable mBackground;
+ private RippleDrawable mRipple;
+ private GradientDrawable mRippleMask;
private int mMargin;
private int mNormalColor;
private int mHighlightColor;
private int mStyle;
- NumPadAnimator(Context context, final GradientDrawable background, @StyleRes int style) {
- mBackground = (GradientDrawable) background.mutate();
+ NumPadAnimator(Context context, LayerDrawable drawable, @StyleRes int style) {
+ LayerDrawable ld = (LayerDrawable) drawable.mutate();
+ mBackground = (GradientDrawable) ld.findDrawableByLayerId(R.id.background);
+ mRipple = (RippleDrawable) ld.findDrawableByLayerId(R.id.ripple);
+ mRippleMask = (GradientDrawable) mRipple.findDrawableByLayerId(android.R.id.mask);
mStyle = style;
reloadColors(context);
@@ -49,13 +56,14 @@ class NumPadAnimator {
// Actual values will be updated later, usually during an onLayout() call
mAnimator = ValueAnimator.ofFloat(0f);
- mAnimator.setDuration(250);
- mAnimator.setInterpolator(Interpolators.LINEAR);
+ mAnimator.setDuration(100);
+ mAnimator.setInterpolator(Interpolators.FAST_OUT_LINEAR_IN);
+ mAnimator.setRepeatMode(ValueAnimator.REVERSE);
+ mAnimator.setRepeatCount(1);
mAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
public void onAnimationUpdate(ValueAnimator anim) {
mBackground.setCornerRadius((float) anim.getAnimatedValue());
- mBackground.setColor(ColorUtils.blendARGB(mHighlightColor, mNormalColor,
- anim.getAnimatedFraction()));
+ mRippleMask.setCornerRadius((float) anim.getAnimatedValue());
}
});
@@ -66,9 +74,9 @@ class NumPadAnimator {
}
void onLayout(int height) {
- float startRadius = height / 10f;
- float endRadius = height / 2f;
- mBackground.setCornerRadius(endRadius);
+ float startRadius = height / 2f;
+ float endRadius = height / 4f;
+ mBackground.setCornerRadius(startRadius);
mAnimator.setFloatValues(startRadius, endRadius);
}
@@ -91,6 +99,7 @@ class NumPadAnimator {
a.recycle();
mBackground.setColor(mNormalColor);
+ mRipple.setColor(ColorStateList.valueOf(mHighlightColor));
}
}
diff --git a/packages/SystemUI/src/com/android/keyguard/NumPadButton.java b/packages/SystemUI/src/com/android/keyguard/NumPadButton.java
index 886c3729124b..8cb1bc4878a5 100644
--- a/packages/SystemUI/src/com/android/keyguard/NumPadButton.java
+++ b/packages/SystemUI/src/com/android/keyguard/NumPadButton.java
@@ -17,7 +17,7 @@ package com.android.keyguard;
import android.content.Context;
import android.content.res.ColorStateList;
-import android.graphics.drawable.GradientDrawable;
+import android.graphics.drawable.LayerDrawable;
import android.graphics.drawable.VectorDrawable;
import android.util.AttributeSet;
import android.view.ContextThemeWrapper;
@@ -37,7 +37,7 @@ public class NumPadButton extends AlphaOptimizedImageButton {
public NumPadButton(Context context, AttributeSet attrs) {
super(context, attrs);
- mAnimator = new NumPadAnimator(context, (GradientDrawable) getBackground(),
+ mAnimator = new NumPadAnimator(context, (LayerDrawable) getBackground(),
attrs.getStyleAttribute());
}
diff --git a/packages/SystemUI/src/com/android/keyguard/NumPadKey.java b/packages/SystemUI/src/com/android/keyguard/NumPadKey.java
index 01e1c632ad83..a4a781dc6ff5 100644
--- a/packages/SystemUI/src/com/android/keyguard/NumPadKey.java
+++ b/packages/SystemUI/src/com/android/keyguard/NumPadKey.java
@@ -18,7 +18,7 @@ package com.android.keyguard;
import android.content.Context;
import android.content.res.TypedArray;
-import android.graphics.drawable.GradientDrawable;
+import android.graphics.drawable.LayerDrawable;
import android.os.PowerManager;
import android.os.SystemClock;
import android.util.AttributeSet;
@@ -127,7 +127,7 @@ public class NumPadKey extends ViewGroup {
setContentDescription(mDigitText.getText().toString());
- mAnimator = new NumPadAnimator(context, (GradientDrawable) getBackground(),
+ mAnimator = new NumPadAnimator(context, (LayerDrawable) getBackground(),
R.style.NumPadKey);
}