Loading res/layout/notification_history_log_row.xml +1 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,7 @@ android:layout_height="wrap_content" android:layout_gravity="left|center_vertical" android:ellipsize="end" android:singleLine="true" android:maxLines="3" android:paddingTop="3dp" android:textAppearance="@style/TextAppearance.NotificationHistory.Text" android:textAlignment="viewStart" /> Loading res/layout/notification_sbn_log_row.xml +1 −1 Original line number Diff line number Diff line Loading @@ -125,7 +125,7 @@ android:layout_height="wrap_content" android:layout_gravity="left|center_vertical" android:ellipsize="end" android:singleLine="true" android:maxLines="3" android:textAppearance="@style/TextAppearance.NotificationHistory.Text" android:textAlignment="viewStart" /> Loading src/com/android/settings/notification/history/NotificationHistoryActivity.java +9 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,15 @@ public class NotificationHistoryActivity extends Activity { final NotificationHistoryRecyclerView rv = viewForPackage.findViewById(R.id.notification_list); rv.setAdapter(new NotificationHistoryAdapter(mNm, rv)); rv.setAdapter(new NotificationHistoryAdapter(mNm, rv, newCount -> { count.setText(getResources().getQuantityString( R.plurals.notification_history_count, newCount, newCount)); if (newCount == 0) { viewForPackage.setVisibility(View.GONE); } })); ((NotificationHistoryAdapter) rv.getAdapter()).onRebuildComplete( new ArrayList<>(nhp.notifications)); Loading src/com/android/settings/notification/history/NotificationHistoryAdapter.java +9 −1 Original line number Diff line number Diff line Loading @@ -49,13 +49,16 @@ public class NotificationHistoryAdapter extends private INotificationManager mNm; private List<HistoricalNotification> mValues; private OnItemDeletedListener mListener; public NotificationHistoryAdapter(INotificationManager nm, NotificationHistoryRecyclerView listView) { NotificationHistoryRecyclerView listView, OnItemDeletedListener listener) { mValues = new ArrayList<>(); setHasStableIds(true); listView.setOnItemSwipeDeleteListener(this); mNm = nm; mListener = listener; } @Override Loading Loading @@ -134,6 +137,11 @@ public class NotificationHistoryAdapter extends Slog.e(TAG, "Failed to delete item", e); } } mListener.onItemDeleted(mValues.size()); notifyItemRemoved(position); } interface OnItemDeletedListener { void onItemDeleted(int newCount); } } src/com/android/settings/notification/history/NotificationSbnAdapter.java +14 −0 Original line number Diff line number Diff line Loading @@ -20,12 +20,16 @@ import static android.app.Notification.COLOR_DEFAULT; import static android.content.pm.PackageManager.MATCH_ANY_USER; import static android.content.pm.PackageManager.NameNotFoundException; import static android.os.UserHandle.USER_ALL; import static android.provider.Settings.EXTRA_APP_PACKAGE; import static android.provider.Settings.EXTRA_CHANNEL_ID; import static android.provider.Settings.EXTRA_CONVERSATION_ID; import android.annotation.ColorInt; import android.annotation.UserIdInt; import android.app.ActivityManager; import android.app.Notification; import android.content.Context; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.res.Configuration; Loading @@ -33,6 +37,7 @@ import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; import android.service.notification.StatusBarNotification; import android.text.TextUtils; import android.util.Log; Loading Loading @@ -113,6 +118,15 @@ public class NotificationSbnAdapter extends holder.setProfileBadge(mUserBadgeCache.get(userId)); holder.addOnClick(sbn.getPackageName(), sbn.getUserId(), sbn.getNotification().contentIntent); holder.itemView.setOnLongClickListener(v -> { Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS) .putExtra(EXTRA_APP_PACKAGE, sbn.getPackageName()) .putExtra(EXTRA_CHANNEL_ID, sbn.getNotification().getChannelId()) .putExtra(EXTRA_CONVERSATION_ID, sbn.getNotification().getShortcutId()); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); holder.itemView.getContext().startActivityAsUser(intent, UserHandle.of(userId)); return true; }); } else { Slog.w(TAG, "null entry in list at position " + position); } Loading Loading
res/layout/notification_history_log_row.xml +1 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,7 @@ android:layout_height="wrap_content" android:layout_gravity="left|center_vertical" android:ellipsize="end" android:singleLine="true" android:maxLines="3" android:paddingTop="3dp" android:textAppearance="@style/TextAppearance.NotificationHistory.Text" android:textAlignment="viewStart" /> Loading
res/layout/notification_sbn_log_row.xml +1 −1 Original line number Diff line number Diff line Loading @@ -125,7 +125,7 @@ android:layout_height="wrap_content" android:layout_gravity="left|center_vertical" android:ellipsize="end" android:singleLine="true" android:maxLines="3" android:textAppearance="@style/TextAppearance.NotificationHistory.Text" android:textAlignment="viewStart" /> Loading
src/com/android/settings/notification/history/NotificationHistoryActivity.java +9 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,15 @@ public class NotificationHistoryActivity extends Activity { final NotificationHistoryRecyclerView rv = viewForPackage.findViewById(R.id.notification_list); rv.setAdapter(new NotificationHistoryAdapter(mNm, rv)); rv.setAdapter(new NotificationHistoryAdapter(mNm, rv, newCount -> { count.setText(getResources().getQuantityString( R.plurals.notification_history_count, newCount, newCount)); if (newCount == 0) { viewForPackage.setVisibility(View.GONE); } })); ((NotificationHistoryAdapter) rv.getAdapter()).onRebuildComplete( new ArrayList<>(nhp.notifications)); Loading
src/com/android/settings/notification/history/NotificationHistoryAdapter.java +9 −1 Original line number Diff line number Diff line Loading @@ -49,13 +49,16 @@ public class NotificationHistoryAdapter extends private INotificationManager mNm; private List<HistoricalNotification> mValues; private OnItemDeletedListener mListener; public NotificationHistoryAdapter(INotificationManager nm, NotificationHistoryRecyclerView listView) { NotificationHistoryRecyclerView listView, OnItemDeletedListener listener) { mValues = new ArrayList<>(); setHasStableIds(true); listView.setOnItemSwipeDeleteListener(this); mNm = nm; mListener = listener; } @Override Loading Loading @@ -134,6 +137,11 @@ public class NotificationHistoryAdapter extends Slog.e(TAG, "Failed to delete item", e); } } mListener.onItemDeleted(mValues.size()); notifyItemRemoved(position); } interface OnItemDeletedListener { void onItemDeleted(int newCount); } }
src/com/android/settings/notification/history/NotificationSbnAdapter.java +14 −0 Original line number Diff line number Diff line Loading @@ -20,12 +20,16 @@ import static android.app.Notification.COLOR_DEFAULT; import static android.content.pm.PackageManager.MATCH_ANY_USER; import static android.content.pm.PackageManager.NameNotFoundException; import static android.os.UserHandle.USER_ALL; import static android.provider.Settings.EXTRA_APP_PACKAGE; import static android.provider.Settings.EXTRA_CHANNEL_ID; import static android.provider.Settings.EXTRA_CONVERSATION_ID; import android.annotation.ColorInt; import android.annotation.UserIdInt; import android.app.ActivityManager; import android.app.Notification; import android.content.Context; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.res.Configuration; Loading @@ -33,6 +37,7 @@ import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; import android.service.notification.StatusBarNotification; import android.text.TextUtils; import android.util.Log; Loading Loading @@ -113,6 +118,15 @@ public class NotificationSbnAdapter extends holder.setProfileBadge(mUserBadgeCache.get(userId)); holder.addOnClick(sbn.getPackageName(), sbn.getUserId(), sbn.getNotification().contentIntent); holder.itemView.setOnLongClickListener(v -> { Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS) .putExtra(EXTRA_APP_PACKAGE, sbn.getPackageName()) .putExtra(EXTRA_CHANNEL_ID, sbn.getNotification().getChannelId()) .putExtra(EXTRA_CONVERSATION_ID, sbn.getNotification().getShortcutId()); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); holder.itemView.getContext().startActivityAsUser(intent, UserHandle.of(userId)); return true; }); } else { Slog.w(TAG, "null entry in list at position " + position); } Loading