Boolean |
callChangeListener(newValue: Any!)
Call this method after the user changes the preference, but before the internal state is set. This allows the client to ignore the user value.
|
Int |
compareTo(other: Preference!)
Compares Preference objects based on order (if set), otherwise alphabetically on the titles.
|
Preference! |
findPreferenceInHierarchy(key: String!)
Finds a Preference in this hierarchy (the whole thing, even above/below your PreferenceScreen screen break) with the given key.
This only functions after we have been attached to a hierarchy.
|
Context! |
getContext()
Returns the android.content.Context of this Preference. Each Preference in a Preference hierarchy can be from different Context (for example, if multiple activities provide preferences into a single PreferenceActivity). This Context will be used to save the Preference values.
|
String! |
getDependency()
Returns the key of the dependency on this Preference.
|
SharedPreferences.Editor! |
getEditor()
Returns an SharedPreferences.Editor where this Preference can save its value(s). Usually it's easier to use one of the helper save methods: persistBoolean(boolean), persistFloat(float), persistInt(int), persistLong(long), persistString(String). To read values, see getSharedPreferences(). If shouldCommit() returns true, it is this Preference's responsibility to commit.
In some cases, writes to this will not be committed right away and hence not show up in the SharedPreferences, this is intended behavior to improve performance.
|
Bundle! |
getExtras()
Return the extras Bundle object associated with this preference, creating a new Bundle if there currently isn't one. You can use this to get and set individual extra key/value pairs.
|
String! |
getFragment()
Return the fragment class name associated with this Preference.
|
Drawable! |
getIcon()
Returns the icon of this Preference.
|
Intent! |
getIntent()
Return the Intent associated with this Preference.
|
String! |
getKey()
Gets the key for this Preference, which is also the key used for storing values into SharedPreferences or PreferenceDataStore.
|
Int |
getLayoutResource()
Gets the layout resource that will be shown as the View for this Preference.
|
Preference.OnPreferenceChangeListener! |
getOnPreferenceChangeListener()
Returns the callback to be invoked when this Preference is changed by the user (but before the internal state has been updated).
|
Preference.OnPreferenceClickListener! |
getOnPreferenceClickListener()
Returns the callback to be invoked when this Preference is clicked.
|
Int |
getOrder()
Gets the order of this Preference with respect to other Preference objects on the same level.
|
PreferenceGroup? |
getParent()
Returns the PreferenceGroup which is this Preference assigned to or null if this preference is not assigned to any group or is a root Preference.
|
Boolean |
getPersistedBoolean(defaultReturnValue: Boolean)
Attempts to get a persisted boolean if this Preference is persistent.
|
Float |
getPersistedFloat(defaultReturnValue: Float)
Attempts to get a persisted float if this Preference is persistent.
|
Int |
getPersistedInt(defaultReturnValue: Int)
Attempts to get a persisted int if this Preference is persistent.
|
Long |
getPersistedLong(defaultReturnValue: Long)
Attempts to get a persisted long if this Preference is persistent.
|
String! |
getPersistedString(defaultReturnValue: String!)
Attempts to get a persisted String if this Preference is persistent.
|
MutableSet<String!>! |
getPersistedStringSet(defaultReturnValue: MutableSet<String!>!)
Attempts to get a persisted set of Strings if this Preference is persistent.
|
PreferenceDataStore? |
getPreferenceDataStore()
Returns PreferenceDataStore used by this Preference. Returns null if android.content.SharedPreferences is used instead.
By default preferences always use android.content.SharedPreferences. To make this preference to use the PreferenceDataStore you need to assign your implementation to the Preference itself via setPreferenceDataStore(PreferenceDataStore) or to its PreferenceManager via PreferenceManager.setPreferenceDataStore(PreferenceDataStore).
|
PreferenceManager! |
getPreferenceManager()
Gets the PreferenceManager that manages this Preference object's tree.
|
SharedPreferences! |
getSharedPreferences()
Returns the SharedPreferences where this Preference can read its value(s). Usually, it's easier to use one of the helper read methods: getPersistedBoolean(boolean), getPersistedFloat(float), getPersistedInt(int), getPersistedLong(long), getPersistedString(String). To save values, see getEditor().
In some cases, writes to the getEditor() will not be committed right away and hence not show up in the returned SharedPreferences, this is intended behavior to improve performance.
|
Boolean |
getShouldDisableView()
Checks whether this Preference should disable its view when it's action is disabled.
|
CharSequence! |
getSummary()
Returns the summary of this Preference.
|
CharSequence! |
getTitle()
Returns the title of this Preference.
|
Int |
getTitleRes()
Returns the title resource ID of this Preference. If the title did not come from a resource, 0 is returned.
|
View! |
getView(convertView: View!, parent: ViewGroup!)
Gets the View that will be shown in the PreferenceActivity.
|
Int |
getWidgetLayoutResource()
Gets the layout resource for the controllable widget portion of this Preference.
|
Boolean |
hasKey()
Checks whether this Preference has a valid key.
|
Boolean |
isEnabled()
Checks whether this Preference should be enabled in the list.
|
Boolean |
isIconSpaceReserved()
Gets whether the space this preference icon view is reserved.
|
Boolean |
isPersistent()
Checks whether this Preference is persistent. If it is, it stores its value(s) into the persistent SharedPreferences storage by default or into PreferenceDataStore if assigned.
|
Boolean |
isRecycleEnabled()
Checks whether this Preference has enabled to have its view recycled when used in the list view.
|
Boolean |
isSelectable()
Checks whether this Preference should be selectable in the list.
|
Boolean |
isSingleLineTitle()
Gets whether the title of this preference is constrained to a single line.
|
Unit |
notifyChanged()
Should be called when the data of this Preference has changed.
|
Unit |
notifyHierarchyChanged()
Should be called when a Preference has been added/removed from this group, or the ordering should be re-evaluated.
|
Unit |
onAttachedToHierarchy(preferenceManager: PreferenceManager!)
Called when this Preference has been attached to a Preference hierarchy. Make sure to call the super implementation.
|
Unit |
onBindView(view: View!)
Binds the created View to the data for this Preference.
This is a good place to grab references to custom Views in the layout and set properties on them.
Make sure to call through to the superclass's implementation. If you override this method you must call through to the superclass implementation.
|
Unit |
onClick()
Processes a click on the preference. This includes saving the value to the SharedPreferences. However, the overridden method should call callChangeListener(Object) to make sure the client wants to update the preference's state with the new value.
|
View! |
onCreateView(parent: ViewGroup!)
Creates the View to be shown for this Preference in the PreferenceActivity. The default behavior is to inflate the main layout of this Preference (see setLayoutResource(int). If changing this behavior, please specify a ViewGroup with ID android.R.id#widget_frame.
Make sure to call through to the superclass's implementation. If you override this method you must call through to the superclass implementation.
|
Unit |
onDependencyChanged(dependency: Preference!, disableDependent: Boolean)
Called when the dependency changes.
|
Any! |
onGetDefaultValue(a: TypedArray!, index: Int)
Called when a Preference is being inflated and the default value attribute needs to be read. Since different Preference types have different value types, the subclass should get and return the default value which will be its value type.
For example, if the value type is String, the body of the method would proxy to TypedArray.getString(int).
|
Unit |
onParentChanged(parent: Preference!, disableChild: Boolean)
Called when the implicit parent dependency changes.
|
Unit |
onRestoreInstanceState(state: Parcelable!)
Hook allowing a Preference to re-apply a representation of its internal state that had previously been generated by onSaveInstanceState. This function will never be called with a null state.
|
Parcelable! |
onSaveInstanceState()
Hook allowing a Preference to generate |