Limit the number of concurrent notifs appear on screen am: abe9246caa

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15531757

Change-Id: Ie041911e9cba51365fc6c26e44f6cd3c3dce60bb
This commit is contained in:
Julia Reynolds
2021-08-11 22:31:14 +00:00
committed by Automerger Merge Worker
3 changed files with 14 additions and 9 deletions

View File

@@ -78,13 +78,14 @@
android:layout_height="1dp" android:layout_height="1dp"
android:background="?android:attr/listDivider"/> android:background="?android:attr/listDivider"/>
<com.android.settings.notification.history.NotificationHistoryRecyclerView <com.android.settings.notification.history.NotificationHistoryRecyclerView
android:id="@+id/notification_list" android:id="@+id/notification_list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="500dp"
android:clipChildren="true" android:clipChildren="true"
android:clipToPadding="true" android:clipToPadding="true"
android:importantForAccessibility="yes" android:clipToOutline="true"
android:scrollbars="none"/> android:importantForAccessibility="yes"
android:scrollbars="none"/>
</LinearLayout> </LinearLayout>

View File

@@ -71,6 +71,11 @@ public class NotificationHistoryAdapter extends
return new NotificationHistoryViewHolder(view); return new NotificationHistoryViewHolder(view);
} }
@Override
public long getItemId(int position) {
return mValues.get(position).hashCode();
}
@Override @Override
public void onBindViewHolder(final @NonNull NotificationHistoryViewHolder holder, public void onBindViewHolder(final @NonNull NotificationHistoryViewHolder holder,
int position) { int position) {

View File

@@ -40,7 +40,6 @@ public class NotificationHistoryRecyclerView extends RecyclerView {
ItemTouchHelper touchHelper = new ItemTouchHelper( ItemTouchHelper touchHelper = new ItemTouchHelper(
new DismissTouchHelper(0, ItemTouchHelper.START | ItemTouchHelper.END)); new DismissTouchHelper(0, ItemTouchHelper.START | ItemTouchHelper.END));
touchHelper.attachToRecyclerView(this); touchHelper.attachToRecyclerView(this);
setNestedScrollingEnabled(false);
} }
public void setOnItemSwipeDeleteListener(OnItemSwipeDeleteListener listener) { public void setOnItemSwipeDeleteListener(OnItemSwipeDeleteListener listener) {