Settings: Set correct categories for GMS top level activities
On new revamped Settings UX dashboard is missing styling for GMS top level activities. This is fixed by assigning them respective categories. Change-Id: I5f18fab2419c8346760c4f6bed6f77e1eac8e059 Signed-off-by: shoya0x00 <shoya0x00@users.noreply.github.com>
This commit is contained in:
committed by
Michael Bestas
parent
6b959b35d8
commit
9486e87179
@@ -79,6 +79,15 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
|
|||||||
private static final String TAG = "DashboardFragment";
|
private static final String TAG = "DashboardFragment";
|
||||||
private static final long TIMEOUT_MILLIS = 50L;
|
private static final long TIMEOUT_MILLIS = 50L;
|
||||||
|
|
||||||
|
private static final List<String> ACCOUNT_INJECTED_KEYS = Arrays.asList(
|
||||||
|
"dashboard_tile_pref_com.google.android.gms.backup.component.BackupOrRestoreSettingsActivity",
|
||||||
|
"top_level_google"
|
||||||
|
);
|
||||||
|
|
||||||
|
private static final List<String> SECURITY_PRIVACY_INJECTED_KEYS = Arrays.asList(
|
||||||
|
"top_level_wellbeing"
|
||||||
|
);
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
final ArrayMap<String, List<DynamicDataObserver>> mDashboardTilePrefKeys = new ArrayMap<>();
|
final ArrayMap<String, List<DynamicDataObserver>> mDashboardTilePrefKeys = new ArrayMap<>();
|
||||||
private final Map<Class, List<AbstractPreferenceController>> mPreferenceControllers =
|
private final Map<Class, List<AbstractPreferenceController>> mPreferenceControllers =
|
||||||
@@ -618,12 +627,17 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
|
|||||||
screen.addPreference(pref);
|
screen.addPreference(pref);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Preference group = null;
|
||||||
if (tile.hasGroupKey()
|
if (tile.hasGroupKey()
|
||||||
&& mDashboardTilePrefKeys.containsKey(tile.getGroupKey())) {
|
&& mDashboardTilePrefKeys.containsKey(tile.getGroupKey())) {
|
||||||
Preference group = screen.findPreference(tile.getGroupKey());
|
group = screen.findPreference(tile.getGroupKey());
|
||||||
|
} else if (ACCOUNT_INJECTED_KEYS.contains(key)) {
|
||||||
|
group = screen.findPreference("top_level_account_category");
|
||||||
|
} else if (SECURITY_PRIVACY_INJECTED_KEYS.contains(key)) {
|
||||||
|
group = screen.findPreference("top_level_security_privacy_category");
|
||||||
|
}
|
||||||
if (group instanceof PreferenceCategory) {
|
if (group instanceof PreferenceCategory) {
|
||||||
((PreferenceCategory) group).addPreference(pref);
|
((PreferenceCategory) group).addPreference(pref);
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
screen.addPreference(pref);
|
screen.addPreference(pref);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user