From b40a38c3397b4294ffd942e8f6bd63bec48125a9 Mon Sep 17 00:00:00 2001 From: Chandru S Date: Fri, 14 Feb 2025 01:50:54 +0000 Subject: 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 --- .../keyguard/KeyguardPinBasedInputView.java | 4 +++- .../src/com/android/keyguard/NumPadButton.java | 28 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) (limited to 'packages/SystemUI/src') 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); + } } -- cgit v1.2.3-59-g8ed1b