Lines Matching refs: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());
164 preference.assignParent(this);
167 preference.onAttachedToActivity();
178 * @param preference The preference to remove.
179 * @return Whether the preference was found and removed.
181 public boolean removePreference(Preference preference) {
182 final boolean returnValue = removePreferenceInt(preference);
187 private boolean removePreferenceInt(Preference preference) {
189 preference.onPrepareForRemoval();
190 if (preference.getParent() == this) {
191 preference.assignParent(null);
193 return mPreferenceList.remove(preference);
213 * @param preference The preference to add.
214 * @return Whether to allow adding the preference (true), or not (false).
216 protected boolean onPrepareAddPreference(Preference preference) {
217 preference.onParentChanged(this, shouldDisableDependents());
224 * returned (to retrieve the other preference with the same key, call this
225 * method on the first preference). If this preference has the key, it will
228 * This will recursively search for the preference into children that are
231 * @param key The key of the preference to retrieve.
240 final Preference preference = getPreference(i);
241 final String curKey = preference.getKey();
244 return preference;
247 if (preference instanceof PreferenceGroup) {
248 final Preference returnedPreference = ((PreferenceGroup)preference)
260 * Whether this preference group should be shown on the same screen as its
264 * screen as this preference.
274 // Mark as attached so if a preference is later added to this group, we