protected void clearAvailableDevices() { availableDevices.removeAll(); }
private static void replaceAllCheckBoxPreferencesBySwitchPreferences( final PreferenceGroup group) { final ArrayList<Preference> preferences = new ArrayList<>(); final int count = group.getPreferenceCount(); for (int index = 0; index < count; index++) { preferences.add(group.getPreference(index)); } group.removeAll(); for (int index = 0; index < count; index++) { final Preference preference = preferences.get(index); if (preference instanceof CheckBoxPreference) { addSwitchPreferenceBasedOnCheckBoxPreference((CheckBoxPreference)preference, group); } else { group.addPreference(preference); if (preference instanceof PreferenceGroup) { replaceAllCheckBoxPreferencesBySwitchPreferences((PreferenceGroup)preference); } } } }
private static void replaceAllCheckBoxPreferencesBySwitchPreferences( final PreferenceGroup group) { final ArrayList<Preference> preferences = new ArrayList<>(); final int count = group.getPreferenceCount(); for (int index = 0; index < count; index++) { preferences.add(group.getPreference(index)); } group.removeAll(); for (int index = 0; index < count; index++) { final Preference preference = preferences.get(index); if (preference instanceof CheckBoxPreference) { addSwitchPreferenceBasedOnCheckBoxPreference((CheckBoxPreference)preference, group); } else { group.addPreference(preference); if (preference instanceof PreferenceGroup) { replaceAllCheckBoxPreferencesBySwitchPreferences((PreferenceGroup)preference); } } } }
private void setPrefSubtypes(final String prefSubtypes, final Context context) { final PreferenceGroup group = getPreferenceScreen(); group.removeAll(); final InputMethodSubtype[] subtypesArray = AdditionalSubtypeUtils.createAdditionalSubtypesArray(prefSubtypes); for (final InputMethodSubtype subtype : subtypesArray) { final CustomInputStylePreference pref = new CustomInputStylePreference(context, subtype, this); group.addPreference(pref); } }
private void rebuildProfileList() { // Add an edit preference for each current Chrome profile. PreferenceGroup profileCategory = (PreferenceGroup) findPreference(PREF_AUTOFILL_PROFILES); profileCategory.removeAll(); for (AutofillProfile profile : PersonalDataManager.getInstance().getProfilesForSettings()) { // Add an item on the current page... Preference pref = new Preference(getActivity()); pref.setTitle(profile.getFullName()); pref.setSummary(profile.getLabel()); if (profile.getIsLocal()) { pref.setFragment(AutofillProfileEditor.class.getName()); } else { pref.setWidgetLayoutResource(R.layout.autofill_server_data_label); pref.setFragment(AutofillServerProfilePreferences.class.getName()); } Bundle args = pref.getExtras(); args.putString(AUTOFILL_GUID, profile.getGUID()); profileCategory.addPreference(pref); } }
private void rebuildCreditCardList() { PreferenceGroup profileCategory = (PreferenceGroup) findPreference(PREF_AUTOFILL_CREDIT_CARDS); profileCategory.removeAll(); for (CreditCard card : PersonalDataManager.getInstance().getCreditCardsForSettings()) { // Add an item on the current page... Preference pref = new Preference(getActivity()); pref.setTitle(card.getObfuscatedNumber()); pref.setSummary(card.getFormattedExpirationDate(getActivity())); if (card.getIsLocal()) { pref.setFragment(AutofillLocalCardEditor.class.getName()); } else { pref.setFragment(AutofillServerCardEditor.class.getName()); pref.setWidgetLayoutResource(R.layout.autofill_server_data_label); } Bundle args = pref.getExtras(); args.putString(AUTOFILL_GUID, card.getGUID()); profileCategory.addPreference(pref); } }
group.removeAll(); for (MeasurementOrderPreference p : preferences) { p.setOrder(DEFAULT_ORDER);