-
- All Implemented Interfaces:
-
android.content.DialogInterface.OnClickListener
,android.content.DialogInterface.OnDismissListener
,android.preference.PreferenceManager.OnActivityDestroyListener
,java.lang.Comparable
public abstract class ListDialogPreference extends DialogPreference
Abstract dialog preference that displays a set of values and optional titles.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
ListDialogPreference.OnValueChangedListener
-
Field Summary
Fields Modifier and Type Field Description private int
value
-
Constructor Summary
Constructors Constructor Description ListDialogPreference(Context context, AttributeSet attrs)
-
Method Summary
Modifier and Type Method Description int
getValue()
void
setValue(int value)
Sets the current value. void
setOnValueChangedListener(ListDialogPreference.OnValueChangedListener listener)
Sets a listened to invoke when the value of this preference changes. void
setListItemLayoutResource(int layoutResId)
Sets the layout to use for grid items. void
setValues(Array<int> values)
Sets the list of item values. void
setTitles(Array<CharSequence> titles)
Sets the list of item titles. CharSequence
getSummary()
-
Methods inherited from class android.preference.DialogPreference
getDialog, getDialogIcon, getDialogLayoutResource, getDialogMessage, getDialogTitle, getNegativeButtonText, getPositiveButtonText, onActivityDestroy, onDismiss, setDialogIcon, setDialogLayoutResource, setDialogMessage, setDialogTitle, setNegativeButtonText, setPositiveButtonText
-
Methods inherited from class android.preference.Preference
compareTo, getContext, getDependency, getEditor, getExtras, getFragment, getIcon, getIntent, getKey, getLayoutResource, getOnPreferenceChangeListener, getOnPreferenceClickListener, getOrder, getParent, getPersistedStringSet, getPreferenceDataStore, getPreferenceManager, getSharedPreferences, getShouldDisableView, getSummary, getTitle, getTitleRes, getView, getWidgetLayoutResource, hasKey, isEnabled, isIconSpaceReserved, isPersistent, isRecycleEnabled, isSelectable, isSingleLineTitle, notifyDependencyChange, onDependencyChanged, onParentChanged, peekExtras, persistStringSet, restoreHierarchyState, saveHierarchyState, setDefaultValue, setDependency, setEnabled, setFragment, setIcon, setIconSpaceReserved, setIntent, setKey, setLayoutResource, setOnPreferenceChangeListener, setOnPreferenceClickListener, setOrder, setPersistent, setPreferenceDataStore, setRecycleEnabled, setSelectable, setShouldDisableView, setSingleLineTitle, setSummary, setTitle, setWidgetLayoutResource, shouldCommit, shouldDisableDependents, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
ListDialogPreference
ListDialogPreference(Context context, AttributeSet attrs)
-
-
Method Detail
-
getValue
int getValue()
-
setValue
void setValue(int value)
Sets the current value. If the value exists within the set of entryvalues, updates the selection index.
- Parameters:
value
- the value to set
-
setOnValueChangedListener
void setOnValueChangedListener(ListDialogPreference.OnValueChangedListener listener)
Sets a listened to invoke when the value of this preference changes.
- Parameters:
listener
- the listener to invoke
-
setListItemLayoutResource
void setListItemLayoutResource(int layoutResId)
Sets the layout to use for grid items.
- Parameters:
layoutResId
- the layout to use for displaying grid items
-
setValues
void setValues(Array<int> values)
Sets the list of item values. Values must be distinct.
- Parameters:
values
- the list of item values
-
setTitles
void setTitles(Array<CharSequence> titles)
Sets the list of item titles. May be null if no titles are specified, ormay be shorter than the list of values to leave some titles unspecified.
- Parameters:
titles
- the list of item titles
-
getSummary
CharSequence getSummary()
-
-
-
-