From faa7083c8baa59156e6f2eeb23d098d899a4990e Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Thu, 16 Sep 2021 16:58:32 -0400 Subject: [PATCH] Shrink notification history views to fit If an app hasn't posted many notifications, don't show extra whitespace after its notifications Test: manual, look at apps that have posted 1-3 notifications, and 10+ Fixes: 199944158 Change-Id: I8ed3e25cd35956eae9ce2fc5677710a34200bdfc --- .../notification_history_app_layout.xml | 30 ++++++++++++++----- .../history/NotificationHistoryActivity.java | 2 +- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/res/layout/notification_history_app_layout.xml b/res/layout/notification_history_app_layout.xml index 24a43c66c71..52c0e421408 100644 --- a/res/layout/notification_history_app_layout.xml +++ b/res/layout/notification_history_app_layout.xml @@ -16,6 +16,7 @@ @@ -78,14 +79,27 @@ android:layout_height="1dp" android:background="?android:attr/listDivider"/> - + android:layout_height="wrap_content"> + + + + \ No newline at end of file diff --git a/src/com/android/settings/notification/history/NotificationHistoryActivity.java b/src/com/android/settings/notification/history/NotificationHistoryActivity.java index 1d663fc1629..ec09a9fabba 100644 --- a/src/com/android/settings/notification/history/NotificationHistoryActivity.java +++ b/src/com/android/settings/notification/history/NotificationHistoryActivity.java @@ -163,7 +163,7 @@ public class NotificationHistoryActivity extends CollapsingToolbarBaseActivity { View viewForPackage = LayoutInflater.from(this) .inflate(R.layout.notification_history_app_layout, null); - final View container = viewForPackage.findViewById(R.id.notification_list); + final View container = viewForPackage.findViewById(R.id.notification_list_wrapper); container.setVisibility(View.GONE); View header = viewForPackage.findViewById(R.id.app_header); NotificationExpandButton expand = viewForPackage.findViewById(