Address the major style differences and make the smart reply buttons
fit better with the other notification UI elements.
This CL does not yet address all the isues but removes the most
obvious inconsistencies.
Screenshot before: https://screenshot.googleplex.com/90QVvxJmUJ3.png
Screenshot after: https://screenshot.googleplex.com/2C8cMQgTVBG.png
Bug:
73605520
Test: In Notify post a Messaging notification with Large chices
Change-Id: Ide285c21c7bf83e9f06ade6912fd13cb3e4b9024
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/notification_ripple_untinted_color">
<item>
- <shape android:shape="rectangle">
- <!-- Use non-zero corner radius to work around b/73285195. The actual corner radius is
- set dynamically at runtime in SmartReplyView. -->
- <corners android:radius="1dp"/>
- <solid android:color="@color/smart_reply_button_background"/>
- </shape>
+ <inset
+ android:insetLeft="0dp"
+ android:insetTop="7dp"
+ android:insetRight="0dp"
+ android:insetBottom="5dp">
+ <shape android:shape="rectangle">
+ <corners android:radius="8dp" />
+ <stroke android:width="1dp" android:color="@color/smart_reply_button_stroke" />
+ <solid android:color="@color/smart_reply_button_background"/>
+ </shape>
+ </inset>
</item>
</ripple>
<!-- android:paddingHorizontal is set dynamically in SmartReplyView. -->
<Button xmlns:android="http://schemas.android.com/apk/res/android"
- style="@android:style/Widget.Material.Button.Borderless.Small"
+ style="@android:style/Widget.Material.Button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:minWidth="0dp"
android:paddingVertical="@dimen/smart_reply_button_padding_vertical"
android:background="@drawable/smart_reply_button_background"
android:gravity="center"
- android:fontFamily="sans-serif"
+ android:fontFamily="sans-serif-medium"
android:textSize="@dimen/smart_reply_button_font_size"
android:lineSpacingExtra="@dimen/smart_reply_button_line_spacing_extra"
android:textColor="@color/smart_reply_button_text"
android:textStyle="normal"
- android:ellipsize="none"/>
\ No newline at end of file
+ android:ellipsize="none"/>
android:id="@+id/smart_reply_view"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
+ android:layout_marginStart="12dp"
systemui:spacing="@dimen/smart_reply_button_spacing"
systemui:singleLineButtonPaddingHorizontal="@dimen/smart_reply_button_padding_horizontal_single_line"
systemui:doubleLineButtonPaddingHorizontal="@dimen/smart_reply_button_padding_horizontal_double_line">
<!-- smart_reply_button(s) will be added here. -->
-</com.android.systemui.statusbar.policy.SmartReplyView>
\ No newline at end of file
+</com.android.systemui.statusbar.policy.SmartReplyView>
<color name="zen_introduction">#ffffffff</color>
- <color name="smart_reply_button_text">#de000000</color> <!-- 87% black -->
- <color name="smart_reply_button_background">#fff2f2f2</color>
+ <color name="smart_reply_button_text">#5F6368</color>
+ <color name="smart_reply_button_background">#feffffff</color>
+ <color name="smart_reply_button_stroke">#ffdadce0</color>
<!-- Fingerprint dialog colors -->
<color name="fingerprint_dialog_bg_color">#ffffffff</color> <!-- 100% white -->
<!-- Smart reply button -->
<dimen name="smart_reply_button_spacing">8dp</dimen>
<dimen name="smart_reply_button_padding_vertical">10dp</dimen>
- <dimen name="smart_reply_button_padding_horizontal_single_line">12dp</dimen>
+ <dimen name="smart_reply_button_padding_horizontal_single_line">16dp</dimen>
<dimen name="smart_reply_button_padding_horizontal_double_line">16dp</dimen>
- <dimen name="smart_reply_button_min_height">40dp</dimen>
+ <dimen name="smart_reply_button_min_height">32dp</dimen>
<dimen name="smart_reply_button_font_size">14sp</dimen>
<dimen name="smart_reply_button_line_spacing_extra">6sp</dimen> <!-- Total line height 20sp. -->
// We're done squeezing buttons, so we can clear the priority queue.
mCandidateButtonQueueForSqueezing.clear();
- // Finally, we need to update corner radius and re-measure some buttons.
- updateCornerRadiusAndRemeasureButtonsIfNecessary(buttonPaddingHorizontal, maxChildHeight);
+ // Finally, we need to re-measure some buttons.
+ remeasureButtonsIfNecessary(buttonPaddingHorizontal, maxChildHeight);
setMeasuredDimension(
resolveSize(Math.max(getSuggestedMinimumWidth(), measuredWidth), widthMeasureSpec),
}
}
- private void updateCornerRadiusAndRemeasureButtonsIfNecessary(
+ private void remeasureButtonsIfNecessary(
int buttonPaddingHorizontal, int maxChildHeight) {
- final float cornerRadius = ((float) maxChildHeight) / 2;
final int maxChildHeightMeasure =
MeasureSpec.makeMeasureSpec(maxChildHeight, MeasureSpec.EXACTLY);
continue;
}
- // Update corner radius.
- GradientDrawable backgroundDrawable =
- (GradientDrawable) ((RippleDrawable) child.getBackground()).getDrawable(0);
- backgroundDrawable.setCornerRadius(cornerRadius);
-
boolean requiresNewMeasure = false;
int newWidth = child.getMeasuredWidth();