From c7a77f60656ea2f1bc9ae295b20b772a250f10b6 Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Fri, 3 Apr 2020 16:56:01 -0400 Subject: [PATCH] Update history flow So the screens are more clear when you don't have history items yet Test: manual Fixes: 150211282 Change-Id: Icf1dded3e92ed2121e18bf9a35d570f9efcfda62 --- res/layout/notification_history.xml | 29 +++++++++++++++++++ res/values/strings.xml | 6 ++++ .../history/NotificationHistoryActivity.java | 18 +++++++++++- 3 files changed, 52 insertions(+), 1 deletion(-) diff --git a/res/layout/notification_history.xml b/res/layout/notification_history.xml index b397eef6540..0e7f6b0210d 100644 --- a/res/layout/notification_history.xml +++ b/res/layout/notification_history.xml @@ -72,6 +72,35 @@ android:focusable="true" android:textAppearance="?android:attr/textAppearanceSmall" android:text="@string/notification_history_off_summary" /> + + + + Turn on notification history to see recent notifications and snoozed notifications + + No recent notifications + + + Your recent and snoozed notifications will appear here + view notification settings diff --git a/src/com/android/settings/notification/history/NotificationHistoryActivity.java b/src/com/android/settings/notification/history/NotificationHistoryActivity.java index 8d7695ff3d8..d41268dcc53 100644 --- a/src/com/android/settings/notification/history/NotificationHistoryActivity.java +++ b/src/com/android/settings/notification/history/NotificationHistoryActivity.java @@ -70,6 +70,8 @@ public class NotificationHistoryActivity extends Activity { private PackageManager mPm; private HistoryLoader.OnHistoryLoaderListener mOnHistoryLoaderListener = notifications -> { + findViewById(R.id.today_list).setVisibility( + notifications.isEmpty() ? View.GONE : View.VISIBLE); // for each package, new header and recycler view for (NotificationHistoryPackage nhp : notifications) { View viewForPackage = LayoutInflater.from(this) @@ -182,6 +184,10 @@ public class NotificationHistoryActivity extends Activity { } else { mHistoryOn.setVisibility(View.GONE); mHistoryOff.setVisibility(View.VISIBLE); + mHistoryOff.findViewById(R.id.history_off_title).setVisibility(View.VISIBLE); + mHistoryOff.findViewById(R.id.history_off_summary).setVisibility(View.VISIBLE); + mHistoryOff.findViewById(R.id.history_toggled_on_title).setVisibility(View.GONE); + mHistoryOff.findViewById(R.id.history_toggled_on_summary).setVisibility(View.GONE); mTodayView.removeAllViews(); } } @@ -232,7 +238,17 @@ public class NotificationHistoryActivity extends Activity { Settings.Secure.putInt(getContentResolver(), NOTIFICATION_HISTORY_ENABLED, isChecked ? 1 : 0); - toggleViews(isChecked); + mHistoryOn.setVisibility(View.GONE); + mHistoryOff.findViewById(R.id.history_off_title).setVisibility( + isChecked ? View.GONE : View.VISIBLE); + mHistoryOff.findViewById(R.id.history_off_summary).setVisibility( + isChecked ? View.GONE : View.VISIBLE); + mHistoryOff.findViewById(R.id.history_toggled_on_title).setVisibility( + isChecked ? View.VISIBLE : View.GONE); + mHistoryOff.findViewById(R.id.history_toggled_on_summary).setVisibility( + isChecked ? View.VISIBLE : View.GONE); + mTodayView.removeAllViews(); + mHistoryOff.setVisibility(View.VISIBLE); }; private final NotificationListenerService mListener = new NotificationListenerService() {