use of com.android.settingslib.TwoTargetPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class DefaultAppPreferenceControllerTest method updateState_twoTargetPref_shouldUseMediumIcon.
@Test
public void updateState_twoTargetPref_shouldUseMediumIcon() {
final TwoTargetPreference pref = mock(TwoTargetPreference.class);
mController = new TestPreferenceController(mContext);
mController.updateState(pref);
verify(pref).setIconSize(ICON_SIZE_MEDIUM);
}
use of com.android.settingslib.TwoTargetPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class DefaultAppPreferenceController method updateState.
@Override
public void updateState(Preference preference) {
final DefaultAppInfo app = getDefaultAppInfo();
CharSequence defaultAppLabel = getDefaultAppLabel();
if (preference instanceof TwoTargetPreference) {
// For use small icon because we are displaying an app preference.
// We only need to do this for TwoTargetPreference because the other prefs are
// already using AppPreference so their icon is already normalized.
((TwoTargetPreference) preference).setIconSize(ICON_SIZE_MEDIUM);
}
if (!TextUtils.isEmpty(defaultAppLabel)) {
preference.setSummary(defaultAppLabel);
Utils.setSafeIcon(preference, getDefaultAppIcon());
} else {
Log.d(TAG, "No default app");
preference.setSummary(R.string.app_list_preference_none);
preference.setIcon(null);
}
mayUpdateGearIcon(app, preference);
}
Aggregations