Loading packages/SystemUI/res/drawable/smart_reply_button_background.xml +1 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ android:insetRight="0dp" android:insetBottom="8dp"> <shape android:shape="rectangle"> <corners android:radius="8dp" /> <corners android:radius="@dimen/smart_reply_button_corner_radius" /> <stroke android:width="@dimen/smart_reply_button_stroke_width" android:color="@color/smart_reply_button_stroke" /> <solid android:color="@color/smart_reply_button_background"/> Loading packages/SystemUI/res/values/dimens.xml +4 −2 Original line number Diff line number Diff line Loading @@ -888,8 +888,10 @@ <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. --> <dimen name="smart_action_button_icon_size">24dp</dimen> <dimen name="smart_action_button_icon_padding">10dp</dimen> <!-- Corner radius = half of min_height to create rounded sides. --> <dimen name="smart_reply_button_corner_radius">24dp</dimen> <dimen name="smart_action_button_icon_size">18dp</dimen> <dimen name="smart_action_button_icon_padding">8dp</dimen> <!-- A reasonable upper bound for the height of the smart reply button. The measuring code needs to start with a guess for the maximum size. Currently two-line smart reply buttons Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java +27 −3 Original line number Diff line number Diff line Loading @@ -479,13 +479,20 @@ public class SmartReplyView extends ViewGroup { remeasureButtonsIfNecessary(accumulatedMeasures.mButtonPaddingHorizontal, accumulatedMeasures.mMaxChildHeight); 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), widthMeasureSpec), resolveSize(Math.max(getSuggestedMinimumHeight(), mPaddingTop + accumulatedMeasures.mMaxChildHeight + mPaddingBottom), heightMeasureSpec)); resolveSize(buttonHeight, heightMeasureSpec)); } /** Loading Loading @@ -806,6 +813,23 @@ public class SmartReplyView extends ViewGroup { button.setTextColor(textColor); } 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); } } } } private ActivityStarter getActivityStarter() { if (mActivityStarter == null) { mActivityStarter = Dependency.get(ActivityStarter.class); Loading Loading
packages/SystemUI/res/drawable/smart_reply_button_background.xml +1 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ android:insetRight="0dp" android:insetBottom="8dp"> <shape android:shape="rectangle"> <corners android:radius="8dp" /> <corners android:radius="@dimen/smart_reply_button_corner_radius" /> <stroke android:width="@dimen/smart_reply_button_stroke_width" android:color="@color/smart_reply_button_stroke" /> <solid android:color="@color/smart_reply_button_background"/> Loading
packages/SystemUI/res/values/dimens.xml +4 −2 Original line number Diff line number Diff line Loading @@ -888,8 +888,10 @@ <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. --> <dimen name="smart_action_button_icon_size">24dp</dimen> <dimen name="smart_action_button_icon_padding">10dp</dimen> <!-- Corner radius = half of min_height to create rounded sides. --> <dimen name="smart_reply_button_corner_radius">24dp</dimen> <dimen name="smart_action_button_icon_size">18dp</dimen> <dimen name="smart_action_button_icon_padding">8dp</dimen> <!-- A reasonable upper bound for the height of the smart reply button. The measuring code needs to start with a guess for the maximum size. Currently two-line smart reply buttons Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java +27 −3 Original line number Diff line number Diff line Loading @@ -479,13 +479,20 @@ public class SmartReplyView extends ViewGroup { remeasureButtonsIfNecessary(accumulatedMeasures.mButtonPaddingHorizontal, accumulatedMeasures.mMaxChildHeight); 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), widthMeasureSpec), resolveSize(Math.max(getSuggestedMinimumHeight(), mPaddingTop + accumulatedMeasures.mMaxChildHeight + mPaddingBottom), heightMeasureSpec)); resolveSize(buttonHeight, heightMeasureSpec)); } /** Loading Loading @@ -806,6 +813,23 @@ public class SmartReplyView extends ViewGroup { button.setTextColor(textColor); } 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); } } } } private ActivityStarter getActivityStarter() { if (mActivityStarter == null) { mActivityStarter = Dependency.get(ActivityStarter.class); Loading