Notification app screen updates

- Load channels asynchronously
- Add importance summary & block/unblock toggle for channel list
- Change channel list headers and sorting.

Test: manual
Change-Id: If024c741df4d85227055563d5bbc8210705c420b
This commit is contained in:
Julia Reynolds
2017-02-08 14:49:01 -05:00
parent aa6e4b5b93
commit 6f57f2c2af
5 changed files with 122 additions and 92 deletions

View File

@@ -230,12 +230,12 @@ public class ChannelNotificationSettings extends NotificationSettingsBase {
List<String> values = new ArrayList<>();;
for (int i = 0; i < numImportances; i++) {
int importance = i + 1;
summaries.add(getSummary(importance));
summaries.add(getImportanceSummary(importance));
values.add(String.valueOf(importance));
}
if (NotificationChannel.DEFAULT_CHANNEL_ID.equals(mChannel.getId())) {
// Add option to reset to letting the app decide
summaries.add(getSummary(NotificationManager.IMPORTANCE_UNSPECIFIED));
summaries.add(getImportanceSummary(NotificationManager.IMPORTANCE_UNSPECIFIED));
values.add(String.valueOf(NotificationManager.IMPORTANCE_UNSPECIFIED));
}
mImportance.setEntryValues(values.toArray(new String[0]));
@@ -256,25 +256,6 @@ public class ChannelNotificationSettings extends NotificationSettingsBase {
});
}
private String getSummary(int importance) {
switch (importance) {
case NotificationManager.IMPORTANCE_UNSPECIFIED:
return getContext().getString(R.string.notification_importance_unspecified);
case NotificationManager.IMPORTANCE_NONE:
return getContext().getString(R.string.notification_importance_blocked);
case NotificationManager.IMPORTANCE_MIN:
return getContext().getString(R.string.notification_importance_min);
case NotificationManager.IMPORTANCE_LOW:
return getContext().getString(R.string.notification_importance_low);
case NotificationManager.IMPORTANCE_DEFAULT:
return getContext().getString(R.string.notification_importance_default);
case NotificationManager.IMPORTANCE_HIGH:
case NotificationManager.IMPORTANCE_MAX:
default:
return getContext().getString(R.string.notification_importance_high);
}
}
protected void setupPriorityPref(boolean priority) {
mPriority.setDisabledByAdmin(mSuspendedAppsAdmin);
mPriority.setChecked(priority);