private void removeSearchProviderDelete() { PreferenceGroup category = (PreferenceGroup) findPreference("providers"); Preference pref = findPreference("deleting-search-providers-names"); if (pref != null) { category.removePreference(pref); } }
private void removeSearchProviderSelect() { PreferenceGroup category = (PreferenceGroup) findPreference("providers"); Preference pref = findPreference("selected-search-provider-names"); if (pref != null) { category.removePreference(pref); } }
CheckBoxPreference chkPref = (CheckBoxPreference)findPreference("myCheckPref"); EditTextPreference editPref1 = (EditTextPreference)findPreference("myEditCheckPref"); PreferenceGroup editTextParent = getParent(editPref1); chkPref.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){ public boolean onPreferenceChange(Preference pref, Object value) { if(value) editTextParent.addPreference(editPref1); else editTextParent.removePreference(editPref1); return true; } });
@Override public void onRemoveCustomInputStyle(final CustomInputStylePreference stylePref) { mIsAddingNewSubtype = false; final PreferenceGroup group = getPreferenceScreen(); group.removePreference(stylePref); mRichImm.setAdditionalInputMethodSubtypes(getSubtypes()); }
@Override protected void onResume() { super.onResume(); int autoTextSize = AutoText.getSize(getListView()); if (autoTextSize < 1) { ((PreferenceGroup) findPreference(PREDICTION_SETTINGS_KEY)) .removePreference(mQuickFixes); } }
private void removeDisabledPreferences(PreferenceGroup root) { if(root == null) return; final List<Preference> toRemove = new ArrayList<Preference>(); for(int i = 0; i != root.getPreferenceCount(); ++i) { final Preference p = root.getPreference(i); if(p == null || CollectionUtils.contains(KEEP_DISABLED, p.getKey())) continue; if(p instanceof PreferenceGroup) removeDisabledPreferences((PreferenceGroup) p); else if(!p.isEnabled()) toRemove.add(p); } for(Preference p : toRemove) root.removePreference(p); }
@Override public void onAddCustomInputStyle(final CustomInputStylePreference stylePref) { mIsAddingNewSubtype = false; final InputMethodSubtype subtype = stylePref.getSubtype(); if (findDuplicatedSubtype(subtype) == null) { mRichImm.setAdditionalInputMethodSubtypes(getSubtypes()); mSubtypePreferenceKeyForSubtypeEnabler = stylePref.getKey(); mSubtypeEnablerNotificationDialog = createDialog(); mSubtypeEnablerNotificationDialog.show(); return; } // Newly added subtype is duplicated. final PreferenceGroup group = getPreferenceScreen(); group.removePreference(stylePref); showSubtypeAlreadyExistsToast(subtype); }
/** Re-examine the device and update if necessary. */ protected void updateAvailableDevice(BluetoothDevice device) { final BluetoothDevicePreference pref = findDevicePreference(device); if (pref != null) { pref.updateBondState(); switch (device.getBondState()) { case BluetoothDevice.BOND_BONDED: pref.setEnabled(false); availableDevices.removePreference(pref); break; case BluetoothDevice.BOND_BONDING: pref.setEnabled(false); break; case BluetoothDevice.BOND_NONE: pref.setEnabled(true); addAvailableDevice(device); break; default: // fall out } } }
@Override public void onSaveCustomInputStyle(final CustomInputStylePreference stylePref) { final InputMethodSubtype subtype = stylePref.getSubtype(); if (!stylePref.hasBeenModified()) { return; } if (findDuplicatedSubtype(subtype) == null) { mRichImm.setAdditionalInputMethodSubtypes(getSubtypes()); return; } // Saved subtype is duplicated. final PreferenceGroup group = getPreferenceScreen(); group.removePreference(stylePref); stylePref.revert(); group.addPreference(stylePref); showSubtypeAlreadyExistsToast(subtype); }
root.removePreference(p); continue;
.removePreference(sideColor); ((PreferenceGroup) findPreference("sideappearance")) .removePreference(sideTextColor);
((PreferenceGroup)findPreference("xdrip_plus_display_category")).removePreference(findPreference("xdrip_plus_number_icon")); } catch (Exception e) { //
((PreferenceGroup)findPreference("xdrip_plus_display_category")).removePreference(findPreference("xdrip_plus_number_icon")); } catch (Exception e) { //