Insetting notifications on the lock screen
We are now insetting the notifications on the
lockscreen.
This also improves the clipping to the notifications
since we can't just clip the whole content to the
outline bounds.
Test: add notifications on lockscreen, observe inset. Try swiping too.
Test: runtest -x packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationCustomViewWrapperTest.java
Bug: 69168591
Change-Id: Ie3f57dd4938bc97124fb98230cc9427fd4973ead
diff --git a/packages/SystemUI/res/layout/notification_info.xml b/packages/SystemUI/res/layout/notification_info.xml
index 6df1657..2e35d86 100644
--- a/packages/SystemUI/res/layout/notification_info.xml
+++ b/packages/SystemUI/res/layout/notification_info.xml
@@ -126,6 +126,7 @@
android:layout_height="48dp"
android:orientation="horizontal"
android:gravity="end"
+ android:layout_marginEnd="@*android:dimen/notification_content_margin_end"
android:layout_marginBottom="8dp" >
<TextView
android:id="@+id/more_settings"
@@ -139,7 +140,6 @@
android:text="@string/notification_done"
android:layout_width="wrap_content"
android:layout_height="match_parent"
- android:layout_marginEnd="8dp"
style="@style/TextAppearance.NotificationInfo.Button"/>
</LinearLayout>
</com.android.systemui.statusbar.NotificationInfo>
diff --git a/packages/SystemUI/res/layout/notification_snooze.xml b/packages/SystemUI/res/layout/notification_snooze.xml
index 3209f27..7476abd 100644
--- a/packages/SystemUI/res/layout/notification_snooze.xml
+++ b/packages/SystemUI/res/layout/notification_snooze.xml
@@ -35,7 +35,7 @@
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
- android:paddingStart="16dp"
+ android:paddingStart="@*android:dimen/notification_content_margin_start"
android:textColor="#DD000000"
android:paddingEnd="4dp"/>
@@ -53,7 +53,7 @@
style="@style/TextAppearance.NotificationInfo.Button"
android:layout_width="wrap_content"
android:layout_height="36dp"
- android:layout_marginEnd="8dp"
+ android:layout_marginEnd="@*android:dimen/notification_content_margin_end"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:text="@string/snooze_undo" />
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index e33b9aa..7449a770 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -101,8 +101,11 @@
<!-- Height of a heads up notification in the status bar -->
<dimen name="notification_max_heads_up_height_increased">188dp</dimen>
+ <!-- Side padding on the lockscreen on the side of notifications -->
+ <dimen name="notification_lockscreen_side_paddings">8dp</dimen>
+
<!-- Additional side padding for custom content if the app doesn't target P yet -->
- <dimen name="notification_content_custom_view_side_padding">8dp</dimen>
+ <dimen name="notification_content_custom_view_side_padding">@dimen/notification_lockscreen_side_paddings</dimen>
<!-- Height of a messaging notifications with actions at least. Not that this is an upper bound
and the notification won't use this much, but is measured with wrap_content -->
diff --git a/packages/SystemUI/res/values/ids.xml b/packages/SystemUI/res/values/ids.xml
index d491df3..35bb946 100644
--- a/packages/SystemUI/res/values/ids.xml
+++ b/packages/SystemUI/res/values/ids.xml
@@ -85,6 +85,10 @@
<item type="id" name="top_roundess_animator_start_tag"/>
<item type="id" name="top_roundess_animator_end_tag"/>
+ <item type="id" name="side_padding_animator_tag"/>
+ <item type="id" name="side_padding_animator_start_tag"/>
+ <item type="id" name="side_padding_animator_end_tag"/>
+
<!-- Accessibility actions for the notification menu -->
<item type="id" name="action_snooze_undo"/>
<item type="id" name="action_snooze_shorter"/>