Clean up notification settings

- Reorganize settings
- Fix dividers
- Add icons
- Fix titles
- Fix colors
- Fix indentation
- Add summaries

Fixes: 190079590
Test: manual inspection, robotests

Change-Id: Ia03219575d3b0c78f9f9b088aa3cdaa29cfdf412
This commit is contained in:
Julia Reynolds
2021-06-17 16:31:35 -04:00
parent 0fcac8bf0d
commit 6a603e7f4b
21 changed files with 231 additions and 135 deletions

View File

@@ -25,9 +25,11 @@ import android.util.Log;
import androidx.preference.Preference;
import androidx.preference.PreferenceGroup;
import androidx.preference.PreferenceScreen;
import androidx.recyclerview.widget.RecyclerView;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settingslib.core.AbstractPreferenceController;
import java.util.ArrayList;
@@ -38,35 +40,11 @@ public class AppNotificationSettings extends NotificationSettings {
private static final String TAG = "AppNotificationSettings";
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
private static String KEY_ADVANCED_CATEGORY = "app_advanced";
private static String KEY_BADGE = "badge";
private static String KEY_APP_LINK = "app_link";
private static String[] LEGACY_NON_ADVANCED_KEYS = {KEY_BADGE, KEY_APP_LINK};
@Override
public int getMetricsCategory() {
return SettingsEnums.NOTIFICATION_APP_NOTIFICATION;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final PreferenceScreen screen = getPreferenceScreen();
if (mShowLegacyChannelConfig && screen != null) {
// if showing legacy settings, pull advanced settings out of the advanced category
PreferenceGroup advanced = (PreferenceGroup) findPreference(KEY_ADVANCED_CATEGORY);
removePreference(KEY_ADVANCED_CATEGORY);
if (advanced != null) {
for (String key : LEGACY_NON_ADVANCED_KEYS) {
Preference pref = advanced.findPreference(key);
advanced.removePreference(pref);
if (pref != null) {
screen.addPreference(pref);
}
}
}
}
}
@Override
public void onResume() {
@@ -78,6 +56,8 @@ public class AppNotificationSettings extends NotificationSettings {
return;
}
getActivity().setTitle(mAppRow.label);
for (NotificationPreferenceController controller : mControllers) {
controller.onResume(mAppRow, mChannel, mChannelGroup, null, null, mSuspendedAppsAdmin,
null);