From 0ffd1564d144748edcdf97d72a5064c1e5c41f1c Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Mon, 10 May 2021 16:33:23 -0400 Subject: [PATCH] Smart action buttons now have 8dp corner radius Bug: 187533622 Test: manual/visual testing Change-Id: I49461363ca5171ff6346b602bf9e90e4bab92c53 --- packages/SystemUI/res/values/dimens.xml | 6 ++--- .../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 c60ec78053eec..24a3baf07e157 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -1148,14 +1148,14 @@ 8dp 14dp - 20dp - 19dp + 16dp + 15dp 48dp 1dp 14sp 6sp - 24dp + 8dp 18dp 8dp 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 edec61832c8e5..9e1ae8b89fc31 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