Lines Matching defs:preference

17 package android.preference;
104 public void addItemFromInflater(Preference preference) {
105 addPreference(preference);
110 * @return The number of preference children in this group.
128 * preference's order.
130 * @param preference The preference to add.
131 * @return Whether the preference is now in this group.
133 public boolean addPreference(Preference preference) {
134 if (mPreferenceList.contains(preference)) {
139 if (preference.getOrder() == Preference.DEFAULT_ORDER) {
141 preference.setOrder(mCurrentPreferenceOrder++);
144 if (preference instanceof PreferenceGroup) {
147 ((PreferenceGroup)preference).setOrderingAsAdded(mOrderingAsAdded);
151 if (!onPrepareAddPreference(preference)) {
156 int insertionIndex = Collections.binarySearch(mPreferenceList, preference);
160 mPreferenceList.add(insertionIndex, preference);
163 preference.onAttachedToHierarchy(getPreferenceManager());
166 preference.onAttachedToActivity();
177 * @param preference The preference to remove.
178 * @return Whether the preference was found and removed.
180 public boolean removePreference(Preference preference) {
181 final boolean returnValue = removePreferenceInt(preference);
186 private boolean removePreferenceInt(Preference preference) {
188 preference.onPrepareForRemoval();
189 return mPreferenceList.remove(preference);
209 * @param preference The preference to add.
210 * @return Whether to allow adding the preference (true), or not (false).
212 protected boolean onPrepareAddPreference(Preference preference) {
213 preference.onParentChanged(this, shouldDisableDependents());
220 * returned (to retrieve the other preference with the same key, call this
221 * method on the first preference). If this preference has the key, it will
224 * This will recursively search for the preference into children that are
227 * @param key The key of the preference to retrieve.
236 final Preference preference = getPreference(i);
237 final String curKey = preference.getKey();
240 return preference;
243 if (preference instanceof PreferenceGroup) {
244 final Preference returnedPreference = ((PreferenceGroup)preference)
256 * Whether this preference group should be shown on the same screen as its
260 * screen as this preference.
270 // Mark as attached so if a preference is later added to this group, we