summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
author Chandru S <chandruis@google.com> 2025-02-14 01:50:54 +0000
committer Chandru S <chandruis@google.com> 2025-02-14 09:17:53 -0800
commitb40a38c3397b4294ffd942e8f6bd63bec48125a9 (patch)
tree55c44fbedd660d06fdd58d24b431f0a9ad162ae1 /packages/SystemUI/src
parent94d37f96824b2b28f1cd8e1bb64b03af58056735 (diff)
Update drawables for confirm and delete button
Specs were updated to use different delete icons for auto-confirm (transparent) mode vs when auto-confirm is not enabled. Confirm button icon changed after UX feedback. Bug: 394136959 Test: verified manually Flag: com.android.systemui.bouncer_ui_revamp_2 Change-Id: I262c283bbeb61f65f1d437a2afc46c74f88830c0
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java4
-rw-r--r--packages/SystemUI/src/com/android/keyguard/NumPadButton.java28
2 files changed, 31 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java
index 245283da75ab..04d4c2a3cdf9 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java
@@ -184,7 +184,9 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView
}
mDeleteButton = findViewById(R.id.delete_button);
if (Flags.bouncerUiRevamp2()) {
- mDeleteButton.setImageResource(R.drawable.pin_bouncer_delete);
+ mDeleteButton.setDrawableForTransparentMode(R.drawable.pin_bouncer_delete_filled);
+ mDeleteButton.setDefaultDrawable(R.drawable.pin_bouncer_delete_outline);
+ mDeleteButton.setImageResource(R.drawable.pin_bouncer_delete_outline);
}
mDeleteButton.setVisibility(View.VISIBLE);
diff --git a/packages/SystemUI/src/com/android/keyguard/NumPadButton.java b/packages/SystemUI/src/com/android/keyguard/NumPadButton.java
index 0ff93236a856..584ebb50520a 100644
--- a/packages/SystemUI/src/com/android/keyguard/NumPadButton.java
+++ b/packages/SystemUI/src/com/android/keyguard/NumPadButton.java
@@ -25,6 +25,7 @@ import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.accessibility.AccessibilityNodeInfo;
+import androidx.annotation.DrawableRes;
import androidx.annotation.Nullable;
import com.android.systemui.Flags;
@@ -42,6 +43,12 @@ public class NumPadButton extends AlphaOptimizedImageButton implements NumPadAni
private int mStyleAttr;
private boolean mIsTransparentMode;
+ @DrawableRes
+ private int mDrawableForTransparentMode = 0;
+
+ @DrawableRes
+ private int mDefaultDrawable = 0;
+
public NumPadButton(Context context, AttributeSet attrs) {
super(context, attrs);
mStyleAttr = attrs.getStyleAttribute();
@@ -123,8 +130,14 @@ public class NumPadButton extends AlphaOptimizedImageButton implements NumPadAni
mIsTransparentMode = isTransparentMode;
if (isTransparentMode) {
+ if (mDrawableForTransparentMode != 0) {
+ setImageResource(mDrawableForTransparentMode);
+ }
setBackgroundColor(getResources().getColor(android.R.color.transparent));
} else {
+ if (mDefaultDrawable != 0) {
+ setImageResource(mDefaultDrawable);
+ }
Drawable bgDrawable = getContext().getDrawable(R.drawable.num_pad_key_background);
if (Flags.bouncerUiRevamp2() && bgDrawable != null) {
bgDrawable.setTint(Color.actionBg);
@@ -154,4 +167,19 @@ public class NumPadButton extends AlphaOptimizedImageButton implements NumPadAni
super.onInitializeAccessibilityNodeInfo(info);
info.setTextEntryKey(true);
}
+
+ /**
+ * Drawable to use when transparent mode is enabled
+ */
+ public void setDrawableForTransparentMode(@DrawableRes int drawableResId) {
+ mDrawableForTransparentMode = drawableResId;
+ }
+
+ /**
+ * Drawable to use when transparent mode is not enabled.
+ */
+ public void setDefaultDrawable(@DrawableRes int drawableResId) {
+ mDefaultDrawable = drawableResId;
+ setImageResource(mDefaultDrawable);
+ }
}