DropDownPreference

open class DropDownPreference : ListPreference
kotlin.Any
   ↳ androidx.preference.Preference
   ↳ androidx.preference.DialogPreference
   ↳ androidx.preference.ListPreference
   ↳ androidx.preference.DropDownPreference

A ListPreference that presents the options in a drop down menu rather than a dialog.

Summary

Inherited constants

Public constructors

<init>(context: Context!)

<init>(context: Context!, attrs: AttributeSet!)

<init>(context: Context!, attrs: AttributeSet!, defStyle: Int)

<init>(context: Context!, attrs: AttributeSet!, defStyleAttr: Int, defStyleRes: Int)

Public methods

open Unit

open Unit
setEntries(@NonNull entries: Array<CharSequence!>)

open Unit

Protected methods

open ArrayAdapter<Any!>!

By default, this class uses a simple ArrayAdapter.

open Unit

open Unit

Inherited functions

Public constructors

<init>

DropDownPreference(context: Context!)

<init>

DropDownPreference(context: Context!, attrs: AttributeSet!)

<init>

DropDownPreference(context: Context!, attrs: AttributeSet!, defStyle: Int)

<init>

DropDownPreference(context: Context!, attrs: AttributeSet!, defStyleAttr: Int, defStyleRes: Int)

Public methods

onBindViewHolder

open fun onBindViewHolder(view: PreferenceViewHolder!): Unit

setEntries

open fun setEntries(@NonNull entries: Array<CharSequence!>): Unit

setValueIndex

open fun setValueIndex(index: Int): Unit

Protected methods

createAdapter

protected open fun createAdapter(): ArrayAdapter<Any!>!

By default, this class uses a simple ArrayAdapter. But if you need a more complicated adapter, this method can be overridden to create a custom one.

Note: This method is called from the constructor. Overridden methods will get called before any subclass initialization.

Return
ArrayAdapter<Any!>!: The custom ArrayAdapter that needs to be used with this class

notifyChanged

protected open fun notifyChanged(): Unit

onClick

protected open fun onClick(): Unit