diff options
| author | 2021-05-10 16:33:23 -0400 | |
|---|---|---|
| committer | 2021-05-10 21:55:05 -0400 | |
| commit | 0ffd1564d144748edcdf97d72a5064c1e5c41f1c (patch) | |
| tree | 065eaf6cee3c46f0fdea127f7ce278527a942781 | |
| parent | c6d567d2399a2e6514f961c04416c8e1f263a428 (diff) | |
Smart action buttons now have 8dp corner radius
Bug: 187533622
Test: manual/visual testing
Change-Id: I49461363ca5171ff6346b602bf9e90e4bab92c53
| -rw-r--r-- | packages/SystemUI/res/values/dimens.xml | 6 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java | 23 |
2 files changed, 3 insertions, 26 deletions
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index c60ec78053ee..24a3baf07e15 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -1148,14 +1148,14 @@ <dimen name="smart_reply_button_spacing">8dp</dimen> <dimen name="smart_reply_button_padding_vertical">14dp</dimen> <!-- Note: The following two paddings need to be different until b/78876518 is fixed. --> - <dimen name="smart_reply_button_padding_horizontal_single_line">20dp</dimen> - <dimen name="smart_reply_button_padding_horizontal_double_line">19dp</dimen> + <dimen name="smart_reply_button_padding_horizontal_single_line">16dp</dimen> + <dimen name="smart_reply_button_padding_horizontal_double_line">15dp</dimen> <dimen name="smart_reply_button_min_height">48dp</dimen> <dimen name="smart_reply_button_stroke_width">1dp</dimen> <dimen name="smart_reply_button_font_size">14sp</dimen> <dimen name="smart_reply_button_line_spacing_extra">6sp</dimen> <!-- Total line height 20sp. --> <!-- Corner radius = half of min_height to create rounded sides. --> - <dimen name="smart_reply_button_corner_radius">24dp</dimen> + <dimen name="smart_reply_button_corner_radius">8dp</dimen> <dimen name="smart_action_button_icon_size">18dp</dimen> <dimen name="smart_action_button_icon_padding">8dp</dimen> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java index edec61832c8e..9e1ae8b89fc3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java @@ -378,12 +378,6 @@ public class SmartReplyView extends ViewGroup { int buttonHeight = Math.max(getSuggestedMinimumHeight(), mPaddingTop + accumulatedMeasures.mMaxChildHeight + mPaddingBottom); - // Set the corner radius to half the button height to make the side of the buttons look like - // a semicircle. - for (View smartSuggestionButton : smartSuggestions) { - setCornerRadius((Button) smartSuggestionButton, ((float) buttonHeight) / 2); - } - setMeasuredDimension( resolveSize(Math.max(getSuggestedMinimumWidth(), accumulatedMeasures.mMeasuredWidth), @@ -725,23 +719,6 @@ public class SmartReplyView extends ViewGroup { button.setTextColor(mCurrentTextColor); } - private void setCornerRadius(Button button, float radius) { - Drawable drawable = button.getBackground(); - if (drawable instanceof RippleDrawable) { - // Mutate in case other notifications are using this drawable. - drawable = drawable.mutate(); - RippleDrawable ripple = (RippleDrawable) drawable; - Drawable inset = ripple.getDrawable(0); - if (inset instanceof InsetDrawable) { - Drawable background = ((InsetDrawable) inset).getDrawable(); - if (background instanceof GradientDrawable) { - GradientDrawable gradientDrawable = (GradientDrawable) background; - gradientDrawable.setCornerRadius(radius); - } - } - } - } - enum SmartButtonType { REPLY, ACTION |