commit | 03ecd3ca01e4225ae435b83fcf336460c2ec5bea | [log] [tgz] |
---|---|---|
author | Julia Reynolds <juliacr@google.com> | Wed Aug 11 22:52:23 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Aug 11 22:52:23 2021 +0000 |
tree | 7bc971e65e91f3716acde92bfdc4f41cf2a8b9fc | |
parent | 0b2493e9643444e2a8ae1344d115dfba17bc0058 [diff] | |
parent | 8c385c261c02030d19a573e2f5f30eb6f58122fb [diff] |
Limit the number of concurrent notifs appear on screen am: abe9246caa am: 8c385c261c Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15531757 Change-Id: I4b188fe0813c63b46e86cd03ff1d2abbdb8fa12b
diff --git a/res/layout/notification_history_app_layout.xml b/res/layout/notification_history_app_layout.xml index 8f66628..24a43c6 100644 --- a/res/layout/notification_history_app_layout.xml +++ b/res/layout/notification_history_app_layout.xml
@@ -78,13 +78,14 @@ android:layout_height="1dp" android:background="?android:attr/listDivider"/> - <com.android.settings.notification.history.NotificationHistoryRecyclerView - android:id="@+id/notification_list" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:clipChildren="true" - android:clipToPadding="true" - android:importantForAccessibility="yes" - android:scrollbars="none"/> + <com.android.settings.notification.history.NotificationHistoryRecyclerView + android:id="@+id/notification_list" + android:layout_width="match_parent" + android:layout_height="500dp" + android:clipChildren="true" + android:clipToPadding="true" + android:clipToOutline="true" + android:importantForAccessibility="yes" + android:scrollbars="none"/> </LinearLayout> \ No newline at end of file
diff --git a/src/com/android/settings/notification/history/NotificationHistoryAdapter.java b/src/com/android/settings/notification/history/NotificationHistoryAdapter.java index 0683ef7..dfa8a30 100644 --- a/src/com/android/settings/notification/history/NotificationHistoryAdapter.java +++ b/src/com/android/settings/notification/history/NotificationHistoryAdapter.java
@@ -72,6 +72,11 @@ } @Override + public long getItemId(int position) { + return mValues.get(position).hashCode(); + } + + @Override public void onBindViewHolder(final @NonNull NotificationHistoryViewHolder holder, int position) { final HistoricalNotification hn = mValues.get(position);
diff --git a/src/com/android/settings/notification/history/NotificationHistoryRecyclerView.java b/src/com/android/settings/notification/history/NotificationHistoryRecyclerView.java index 06c74bc..224c31d 100644 --- a/src/com/android/settings/notification/history/NotificationHistoryRecyclerView.java +++ b/src/com/android/settings/notification/history/NotificationHistoryRecyclerView.java
@@ -40,7 +40,6 @@ ItemTouchHelper touchHelper = new ItemTouchHelper( new DismissTouchHelper(0, ItemTouchHelper.START | ItemTouchHelper.END)); touchHelper.attachToRecyclerView(this); - setNestedScrollingEnabled(false); } public void setOnItemSwipeDeleteListener(OnItemSwipeDeleteListener listener) {