Removed the notification action background
Also added conditional paddings when inline
replying, such that the layout looks good.
This refactors the overall layout design and ensures
that smart replies and other content that is on
the bottom are always visible.
Bug: 69168591
Test: add notification, reply, no action background
Change-Id: I83d3f0d2512f0cf8c8b9db0edc7b27cbb109aeb9
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 28ecd98..3797cac 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -4587,7 +4587,8 @@
big.setViewVisibility(R.id.notification_material_reply_text_3, View.GONE);
big.setTextViewText(R.id.notification_material_reply_text_3, null);
- big.setViewLayoutMarginBottomDimen(R.id.notification_action_list_margin_target, 0);
+ big.setViewLayoutMarginBottomDimen(R.id.notification_action_list_margin_target,
+ R.dimen.notification_content_margin);
}
private RemoteViews applyStandardTemplateWithActions(int layoutId) {
@@ -4608,16 +4609,7 @@
if (N > 0) {
big.setViewVisibility(R.id.actions_container, View.VISIBLE);
big.setViewVisibility(R.id.actions, View.VISIBLE);
- if (p.ambient) {
- big.setInt(R.id.actions, "setBackgroundColor", Color.TRANSPARENT);
- } else if (isColorized()) {
- big.setInt(R.id.actions, "setBackgroundColor", getActionBarColor());
- } else {
- big.setInt(R.id.actions, "setBackgroundColor", mContext.getColor(
- R.color.notification_action_list));
- }
- big.setViewLayoutMarginBottomDimen(R.id.notification_action_list_margin_target,
- R.dimen.notification_action_list_height);
+ big.setViewLayoutMarginBottomDimen(R.id.notification_action_list_margin_target, 0);
if (N>MAX_ACTION_BUTTONS) N=MAX_ACTION_BUTTONS;
for (int i=0; i<N; i++) {
Action action = mActions.get(i);
diff --git a/core/res/res/layout/notification_material_action_list.xml b/core/res/res/layout/notification_material_action_list.xml
index 49b0ee7..07559f4 100644
--- a/core/res/res/layout/notification_material_action_list.xml
+++ b/core/res/res/layout/notification_material_action_list.xml
@@ -24,11 +24,9 @@
android:layout_width="match_parent"
android:layout_height="@dimen/notification_action_list_height"
android:paddingEnd="12dp"
- android:paddingStart="8dp"
android:orientation="horizontal"
android:gravity="center_vertical"
android:visibility="gone"
- android:background="@color/notification_action_list"
>
<!-- actions will be added here -->
</com.android.internal.widget.NotificationActionListLayout>
diff --git a/core/res/res/layout/notification_material_reply_text.xml b/core/res/res/layout/notification_material_reply_text.xml
index bc22eb4..84603b0 100644
--- a/core/res/res/layout/notification_material_reply_text.xml
+++ b/core/res/res/layout/notification_material_reply_text.xml
@@ -28,7 +28,8 @@
android:layout_width="match_parent"
android:layout_height="1dip"
android:id="@+id/action_divider"
- android:layout_marginBottom="15dp"
+ android:layout_marginTop="@dimen/notification_content_margin"
+ android:layout_marginBottom="@dimen/notification_content_margin"
android:background="@drawable/notification_template_divider" />
<TextView
@@ -53,7 +54,6 @@
android:id="@+id/notification_material_reply_text_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="15dp"
android:layout_marginEnd="@dimen/notification_content_margin_end"
android:textAppearance="@style/TextAppearance.Material.Notification.Reply"
android:singleLine="true" />
diff --git a/core/res/res/layout/notification_template_material_ambient.xml b/core/res/res/layout/notification_template_material_ambient.xml
index 19c4d23..525d493 100644
--- a/core/res/res/layout/notification_template_material_ambient.xml
+++ b/core/res/res/layout/notification_template_material_ambient.xml
@@ -88,7 +88,6 @@
android:orientation="horizontal"
android:gravity="center"
android:visibility="gone"
- android:background="@color/notification_action_list"
/>
</FrameLayout>
</FrameLayout>
diff --git a/core/res/res/layout/notification_template_material_base.xml b/core/res/res/layout/notification_template_material_base.xml
index 445b19b..221bcf6 100644
--- a/core/res/res/layout/notification_template_material_base.xml
+++ b/core/res/res/layout/notification_template_material_base.xml
@@ -30,7 +30,7 @@
android:layout_marginStart="@dimen/notification_content_margin_start"
android:layout_marginEnd="@dimen/notification_content_margin_end"
android:layout_marginTop="@dimen/notification_content_margin_top"
- android:layout_marginBottom="@dimen/notification_content_margin_bottom"
+ android:layout_marginBottom="@dimen/notification_content_margin"
android:orientation="vertical" >
<include layout="@layout/notification_template_part_line1" />
<include layout="@layout/notification_template_text" />
@@ -42,7 +42,7 @@
<include layout="@layout/notification_template_smart_reply_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/notification_content_margin_bottom" />
+ android:layout_marginTop="@dimen/notification_content_margin" />
</LinearLayout>
<include layout="@layout/notification_template_right_icon" />
</FrameLayout>
diff --git a/core/res/res/layout/notification_template_material_big_base.xml b/core/res/res/layout/notification_template_material_big_base.xml
index d47bff6..2106890 100644
--- a/core/res/res/layout/notification_template_material_big_base.xml
+++ b/core/res/res/layout/notification_template_material_big_base.xml
@@ -20,6 +20,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
+ android:clipChildren="false"
android:tag="big" >
<LinearLayout
android:id="@+id/notification_action_list_margin_target"
@@ -30,6 +31,7 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_weight="1"
android:layout_gravity="top" >
<include layout="@layout/notification_template_header" />
<LinearLayout
@@ -39,7 +41,6 @@
android:layout_marginStart="@dimen/notification_content_margin_start"
android:layout_marginEnd="@dimen/notification_content_margin_end"
android:layout_marginTop="@dimen/notification_content_margin_top"
- android:layout_marginBottom="@dimen/notification_content_margin_bottom"
android:orientation="vertical" >
<include layout="@layout/notification_template_part_line1" />
<include layout="@layout/notification_template_text" />
@@ -61,7 +62,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/notification_content_margin_start"
android:layout_marginEnd="@dimen/notification_content_margin_end"
- android:layout_marginBottom="@dimen/notification_content_margin_bottom" />
+ android:layout_marginTop="@dimen/notification_content_margin" />
+ <include layout="@layout/notification_material_action_list" />
</LinearLayout>
- <include layout="@layout/notification_material_action_list" />
</FrameLayout>
diff --git a/core/res/res/layout/notification_template_material_big_media.xml b/core/res/res/layout/notification_template_material_big_media.xml
index cc4dd387..b4e26483 100644
--- a/core/res/res/layout/notification_template_material_big_media.xml
+++ b/core/res/res/layout/notification_template_material_big_media.xml
@@ -46,7 +46,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/notification_content_margin_top"
android:layout_marginStart="@dimen/notification_content_margin_start"
- android:layout_marginBottom="@dimen/notification_content_margin_bottom"
+ android:layout_marginBottom="@dimen/notification_content_margin"
android:layout_marginEnd="@dimen/notification_content_margin_end"
android:minHeight="@dimen/notification_min_content_height"
android:orientation="vertical"
diff --git a/core/res/res/layout/notification_template_material_big_picture.xml b/core/res/res/layout/notification_template_material_big_picture.xml
index 76c0a67..7a1cc1e 100644
--- a/core/res/res/layout/notification_template_material_big_picture.xml
+++ b/core/res/res/layout/notification_template_material_big_picture.xml
@@ -20,17 +20,18 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:tag="bigPicture"
+ android:clipChildren="false"
>
<include layout="@layout/notification_template_header" />
<include layout="@layout/notification_template_right_icon" />
<LinearLayout
+ android:id="@+id/notification_action_list_margin_target"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="top"
android:layout_marginTop="@dimen/notification_content_margin_top"
android:clipToPadding="false"
android:orientation="vertical"
- android:id="@+id/notification_action_list_margin_target"
>
<LinearLayout
android:id="@+id/notification_main_column"
@@ -53,7 +54,6 @@
android:adjustViewBounds="true"
android:layout_weight="1"
android:layout_marginTop="13dp"
- android:layout_marginBottom="16dp"
android:layout_marginStart="@dimen/notification_content_margin_start"
android:layout_marginEnd="@dimen/notification_content_margin_end"
android:scaleType="centerCrop"
@@ -69,7 +69,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/notification_content_margin_start"
android:layout_marginEnd="@dimen/notification_content_margin_end"
- android:layout_marginBottom="@dimen/notification_content_margin_bottom" />
+ android:layout_marginTop="@dimen/notification_content_margin" />
+ <include layout="@layout/notification_material_action_list" />
</LinearLayout>
- <include layout="@layout/notification_material_action_list" />
</FrameLayout>
diff --git a/core/res/res/layout/notification_template_material_big_text.xml b/core/res/res/layout/notification_template_material_big_text.xml
index ac4c052..3a6f573 100644
--- a/core/res/res/layout/notification_template_material_big_text.xml
+++ b/core/res/res/layout/notification_template_material_big_text.xml
@@ -19,6 +19,7 @@
android:id="@+id/status_bar_latest_event_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:clipChildren="false"
android:tag="bigText"
>
<include layout="@layout/notification_template_header" />
@@ -43,6 +44,7 @@
android:clipToPadding="false"
android:minHeight="@dimen/notification_min_content_height"
android:orientation="vertical"
+ android:layout_weight="1"
>
<include layout="@layout/notification_template_part_line1" />
<include layout="@layout/notification_template_progress"
@@ -54,7 +56,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/notification_text_margin_top"
- android:paddingBottom="@dimen/notification_content_margin_bottom"
android:textAppearance="@style/TextAppearance.Material.Notification"
android:singleLine="false"
android:gravity="top"
@@ -68,12 +69,12 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<include layout="@layout/notification_template_smart_reply_container"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginStart="@dimen/notification_content_margin_start"
- android:layout_marginEnd="@dimen/notification_content_margin_end"
- android:layout_marginBottom="@dimen/notification_content_margin_bottom" />
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/notification_content_margin_start"
+ android:layout_marginEnd="@dimen/notification_content_margin_end"
+ android:layout_marginTop="@dimen/notification_content_margin" />
+ <include layout="@layout/notification_material_action_list" />
</LinearLayout>
- <include layout="@layout/notification_material_action_list" />
<include layout="@layout/notification_template_right_icon" />
</FrameLayout>
diff --git a/core/res/res/layout/notification_template_material_inbox.xml b/core/res/res/layout/notification_template_material_inbox.xml
index 718cf16..23d8799 100644
--- a/core/res/res/layout/notification_template_material_inbox.xml
+++ b/core/res/res/layout/notification_template_material_inbox.xml
@@ -20,6 +20,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:tag="inbox"
+ android:clipChildren="false"
>
<include layout="@layout/notification_template_header" />
<LinearLayout
@@ -38,8 +39,8 @@
android:layout_gravity="top"
android:paddingStart="@dimen/notification_content_margin_start"
android:paddingEnd="@dimen/notification_content_margin_end"
- android:paddingBottom="@dimen/notification_content_margin_bottom"
android:minHeight="@dimen/notification_min_content_height"
+ android:layout_weight="1"
android:clipToPadding="false"
android:orientation="vertical"
>
@@ -124,8 +125,8 @@
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/notification_content_margin_start"
android:layout_marginEnd="@dimen/notification_content_margin_end"
- android:layout_marginBottom="@dimen/notification_content_margin_bottom" />
+ android:layout_marginTop="@dimen/notification_content_margin" />
+ <include layout="@layout/notification_material_action_list" />
</LinearLayout>
- <include layout="@layout/notification_material_action_list" />
<include layout="@layout/notification_template_right_icon" />
</FrameLayout>
diff --git a/core/res/res/layout/notification_template_material_media.xml b/core/res/res/layout/notification_template_material_media.xml
index 2c69b90..3a0912b 100644
--- a/core/res/res/layout/notification_template_material_media.xml
+++ b/core/res/res/layout/notification_template_material_media.xml
@@ -49,7 +49,7 @@
android:layout_gravity="fill_vertical"
android:layout_weight="1"
android:minHeight="@dimen/notification_min_content_height"
- android:paddingBottom="@dimen/notification_content_margin_bottom"
+ android:paddingBottom="@dimen/notification_content_margin"
android:orientation="vertical"
>
<include layout="@layout/notification_template_part_line1"/>
diff --git a/core/res/res/layout/notification_template_material_messaging.xml b/core/res/res/layout/notification_template_material_messaging.xml
index 34f5ae8..53514a3 100644
--- a/core/res/res/layout/notification_template_material_messaging.xml
+++ b/core/res/res/layout/notification_template_material_messaging.xml
@@ -19,10 +19,11 @@
android:id="@+id/status_bar_latest_event_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:clipChildren="false"
android:tag="messaging"
>
<include layout="@layout/notification_template_header"/>
- <LinearLayout
+ <com.android.internal.widget.RemeasuringLinearLayout
android:id="@+id/notification_action_list_margin_target"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -31,15 +32,15 @@
android:clipToPadding="false"
android:orientation="vertical">
- <LinearLayout
+ <com.android.internal.widget.RemeasuringLinearLayout
android:id="@+id/notification_main_column"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
+ android:layout_weight="1"
android:layout_marginStart="@dimen/notification_content_margin_start"
android:layout_marginEnd="@dimen/notification_content_margin_end"
android:minHeight="@dimen/notification_min_content_height"
- android:layout_marginBottom="@dimen/notification_content_margin_bottom"
android:orientation="vertical"
>
<com.android.internal.widget.MessagingLinearLayout
@@ -47,12 +48,12 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:spacing="@dimen/notification_messaging_spacing" />
- <include layout="@layout/notification_template_smart_reply_container"
+ </com.android.internal.widget.RemeasuringLinearLayout>
+ <include layout="@layout/notification_template_smart_reply_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/notification_content_margin_bottom" />
- </LinearLayout>
- </LinearLayout>
- <include layout="@layout/notification_material_action_list" />
+ android:layout_marginTop="@dimen/notification_content_margin" />
+ <include layout="@layout/notification_material_action_list" />
+ </com.android.internal.widget.RemeasuringLinearLayout>
<include layout="@layout/notification_template_right_icon"/>
</com.android.internal.widget.MessagingLayout>
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index cfaab6a..2ce08eb 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -176,13 +176,13 @@
<dimen name="notification_extra_margin_ambient">16dp</dimen>
<!-- The height of the notification action list -->
- <dimen name="notification_action_list_height">56dp</dimen>
+ <dimen name="notification_action_list_height">60dp</dimen>
<!-- height of the content margin to accomodate for the header -->
<dimen name="notification_content_margin_top">46dp</dimen>
- <!-- height of the content margin on the bottom -->
- <dimen name="notification_content_margin_bottom">20dp</dimen>
+ <!-- height of the content margin that is applied at the end of the notification content -->
+ <dimen name="notification_content_margin">20dp</dimen>
<!-- The height of the progress bar. -->
<dimen name="notification_progress_bar_height">15dp</dimen>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 863a8cd..dc50202 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2646,7 +2646,7 @@
<java-symbol type="dimen" name="notification_content_margin_end" />
<java-symbol type="dimen" name="notification_content_picture_margin" />
<java-symbol type="dimen" name="notification_content_margin_top" />
- <java-symbol type="dimen" name="notification_content_margin_bottom" />
+ <java-symbol type="dimen" name="notification_content_margin" />
<java-symbol type="dimen" name="notification_header_background_height" />
<java-symbol type="dimen" name="notification_header_height" />
<java-symbol type="dimen" name="notification_header_expand_icon_size" />