Fine tune the icon size for some pages

Based on our Android S spec, we should make the size smaller for icons.

Test:
Notification access: https://screenshot.googleplex.com/Ah8wjmzggDQyhmP
Device admin: https://screenshot.googleplex.com/5tS64HxZz3ywPZZ
Fix: 174739497
Change-Id: Iad4a48b558084d7374fec515891d01d3e7d41108
This commit is contained in:
Tsung-Mao Fang
2020-12-03 20:51:51 +08:00
parent 424a15fc99
commit 3d01afc621
2 changed files with 10 additions and 10 deletions

View File

@@ -46,7 +46,7 @@ import androidx.preference.PreferenceScreen;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.widget.FilterTouchesSwitchPreference;
import com.android.settings.widget.AppSwitchPreference;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import com.android.settingslib.core.lifecycle.LifecycleObserver;
import com.android.settingslib.core.lifecycle.events.OnStart;
@@ -168,32 +168,32 @@ public class DeviceAdminListPreferenceController extends BasePreferenceControlle
if (mFooterPreference != null) {
mFooterPreference.setVisible(mAdmins.isEmpty());
}
final Map<String, FilterTouchesSwitchPreference> preferenceCache = new ArrayMap<>();
final Map<String, AppSwitchPreference> preferenceCache = new ArrayMap<>();
final Context prefContext = mPreferenceGroup.getContext();
final int childrenCount = mPreferenceGroup.getPreferenceCount();
for (int i = 0; i < childrenCount; i++) {
final Preference pref = mPreferenceGroup.getPreference(i);
if (!(pref instanceof FilterTouchesSwitchPreference)) {
if (!(pref instanceof AppSwitchPreference)) {
continue;
}
final FilterTouchesSwitchPreference appSwitch = (FilterTouchesSwitchPreference) pref;
final AppSwitchPreference appSwitch = (AppSwitchPreference) pref;
preferenceCache.put(appSwitch.getKey(), appSwitch);
}
for (DeviceAdminListItem item : mAdmins) {
final String key = item.getKey();
FilterTouchesSwitchPreference pref = preferenceCache.remove(key);
AppSwitchPreference pref = preferenceCache.remove(key);
if (pref == null) {
pref = new FilterTouchesSwitchPreference(prefContext);
pref = new AppSwitchPreference(prefContext);
mPreferenceGroup.addPreference(pref);
}
bindPreference(item, pref);
}
for (FilterTouchesSwitchPreference unusedCacheItem : preferenceCache.values()) {
for (AppSwitchPreference unusedCacheItem : preferenceCache.values()) {
mPreferenceGroup.removePreference(unusedCacheItem);
}
}
private void bindPreference(DeviceAdminListItem item, FilterTouchesSwitchPreference pref) {
private void bindPreference(DeviceAdminListItem item, AppSwitchPreference pref) {
pref.setKey(item.getKey());
pref.setTitle(item.getName());
pref.setIcon(item.getIcon());