PreferenceDialogFragment
abstract class PreferenceDialogFragment : DialogFragment, OnClickListener
kotlin.Any | |||
↳ | android.app.Fragment | ||
↳ | android.app.DialogFragment | ||
↳ | androidx.preference.PreferenceDialogFragment |
Abstract base class which presents a dialog associated with a DialogPreference
. Since the preference object may not be available during fragment re-creation, the necessary information for displaying the dialog is read once during the initial call to #onCreate(Bundle)
and saved/restored in the saved instance state. Custom subclasses should also follow this pattern.
Summary
Constants | |
---|---|
static String |
Public constructors | |
---|---|
<init>() |
Public methods | |
---|---|
open Unit |
onClick(dialog: DialogInterface!, which: Int) |
open DialogPreference! |
Get the preference that requested this dialog. |
open Unit | |
open Unit |
onDismiss(dialog: DialogInterface!) |
open Unit |
onSaveInstanceState(outState: Bundle) |
open Dialog |
onCreateDialog(savedInstanceState: Bundle!) |
abstract Unit |
onDialogClosed(positiveResult: Boolean) |
Protected methods | |
---|---|
open Unit |
onPrepareDialogBuilder(builder: Builder!) Prepares the dialog builder to be shown when the preference is clicked. |
open View! |
onCreateDialogView(context: Context!) Creates the content view for the dialog (if a custom content view is required). |
open Unit |
onBindDialogView(view: View!) Binds views in the content view of the dialog to data. |
Constants
Public constructors
<init>
PreferenceDialogFragment()
Public methods
onClick
open fun onClick(dialog: DialogInterface!, which: Int): Unit
getPreference
open fun getPreference(): DialogPreference!
Get the preference that requested this dialog. Available after #onCreate(Bundle)
has been called on the PreferenceFragment
which launched this dialog.
Return | |
---|---|
DialogPreference!: The DialogPreference associated with this dialog |
onDismiss
open fun onDismiss(dialog: DialogInterface!): Unit
Protected methods
onPrepareDialogBuilder
protected open fun onPrepareDialogBuilder(builder: Builder!): Unit
Prepares the dialog builder to be shown when the preference is clicked. Use this to set custom properties on the dialog.
Do not AlertDialog.Builder#create()
or AlertDialog.Builder#show()
.
onCreateDialogView
protected open fun onCreateDialogView(context: Context!): View!
Creates the content view for the dialog (if a custom content view is required). By default, it inflates the dialog layout resource if it is set.
Return | |
---|---|
View!: The content view for the dialog |
onBindDialogView
protected open fun onBindDialogView(view: View!): Unit
Binds views in the content view of the dialog to data.
Make sure to call through to the superclass implementation.
Parameters | |
---|---|
view |
View!: The content view of the dialog, if it is custom |
Interfaces
- PreferenceGroup.PreferencePositionCallback
- PreferenceFragment.OnPreferenceDisplayDialogCallback
- PreferenceFragment.OnPreferenceStartFragmentCallback
- PreferenceFragment.OnPreferenceStartScreenCallback
- PreferenceManager.OnDisplayPreferenceDialogListener
- PreferenceManager.OnNavigateToScreenListener
- PreferenceManager.OnPreferenceTreeClickListener
- Preference.OnPreferenceChangeListener
- Preference.OnPreferenceClickListener
- DialogPreference.TargetFragment
- PreferenceFragmentCompat.OnPreferenceDisplayDialogCallback
- PreferenceFragmentCompat.OnPreferenceStartFragmentCallback
- PreferenceFragmentCompat.OnPreferenceStartScreenCallback
Classes
- EditTextPreferenceDialogFragmentCompat
- MultiSelectListPreferenceDialogFragmentCompat
- PreferenceDataStore
- TwoStatePreference
- ListPreferenceDialogFragmentCompat
- EditTextPreferenceDialogFragment
- ListPreference
- PreferenceGroup
- PreferenceScreen
- DropDownPreference
- CheckBoxPreference
- SeekBarPreference
- MultiSelectListPreference
- PreferenceFragment
- SwitchPreference
- PreferenceViewHolder
- PreferenceManager
- PreferenceManager.PreferenceComparisonCallback
- PreferenceManager.SimplePreferenceComparisonCallback
- Preference
- Preference.BaseSavedState
- ListPreferenceDialogFragment
- DialogPreference
- PreferenceCategory
- MultiSelectListPreferenceDialogFragment
- PreferenceDialogFragment
- SwitchPreferenceCompat
- EditTextPreference
- PreferenceFragmentCompat
- PreferenceDialogFragmentCompat