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(@NonNull other: Preference)
Compares preference objects based on order (if set), otherwise alphabetically on the titles.
|
T? |
findPreferenceInHierarchy(@NonNull key: String)
Finds a preference in the entire hierarchy (above or below this preference) with the given key. Returns null if no preference could be found with the given key.
This only works after this preference has been attached to a hierarchy.
|
Context! |
getContext()
Returns the 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 PreferenceFragmentCompat ). This Context will be used to save the preference values.
|
String! |
getDependency()
Returns the key of the dependency on this preference.
|
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 Integer 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 set of Strings 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 SharedPreferences is used instead.
By default preferences always use 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) .
|
Boolean |
getShouldDisableView()
Checks whether this preference should disable its view when it's action is disabled.
|
CharSequence! |
getSummary()
Returns the summary of this preference. If a SummaryProvider has been set for this preference, it will be used to provide the summary returned by this method.
|
Preference.SummaryProvider<Preference!>? |
getSummaryProvider()
Returns the SummaryProvider used to configure the summary of this preference.
|
CharSequence! |
getTitle()
Returns the title of this preference.
|
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 |
isCopyingEnabled()
Returns whether the summary of this preference can be copied to the clipboard by long pressing on the preference.
|
Boolean |
isEnabled()
Checks whether this preference should be enabled in the list.
|
Boolean |
isIconSpaceReserved()
Returns whether the space of 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 |
isSelectable()
Checks whether this preference should be selectable in the list.
|
Boolean |
isShown()
Checks whether this preference is shown to the user in the hierarchy. For a preference to be shown in the hierarchy, it and all of its ancestors must be visible and attached to the root PreferenceScreen .
|
Boolean |
isSingleLineTitle()
Gets whether the title of this preference is constrained to a single line.
|
Boolean |
isVisible()
Checks whether this preference should be visible to the user. If this preference is visible, but one or more of its ancestors are not visible, then this preference will not be shown until its ancestors are all visible.
|
Unit |
notifyChanged |