public abstract class ListDialogPreference
extends android.preference.DialogPreference
Modifier and Type | Class and Description |
---|---|
static interface |
ListDialogPreference.OnValueChangedListener |
Constructor and Description |
---|
ListDialogPreference(android.content.Context context,
android.util.AttributeSet attrs) |
Modifier and Type | Method and Description |
---|---|
protected int |
getIndexForValue(int value) |
java.lang.CharSequence |
getSummary() |
protected java.lang.CharSequence |
getTitleAt(int index) |
int |
getValue() |
protected int |
getValueAt(int index) |
protected abstract void |
onBindListItem(android.view.View view,
int index)
Populates a list item view with data for the specified index.
|
protected java.lang.Object |
onGetDefaultValue(android.content.res.TypedArray a,
int index) |
protected void |
onPrepareDialogBuilder(android.app.AlertDialog.Builder builder) |
protected void |
onRestoreInstanceState(android.os.Parcelable state) |
protected android.os.Parcelable |
onSaveInstanceState() |
protected void |
onSetInitialValue(boolean restoreValue,
java.lang.Object defaultValue) |
void |
setListItemLayoutResource(int layoutResId)
Sets the layout to use for grid items.
|
void |
setOnValueChangedListener(ListDialogPreference.OnValueChangedListener listener)
Sets a listened to invoke when the value of this preference changes.
|
void |
setTitles(java.lang.CharSequence[] titles)
Sets the list of item titles.
|
void |
setValue(int value)
Sets the current value.
|
void |
setValues(int[] values)
Sets the list of item values.
|
getDialog, getDialogIcon, getDialogLayoutResource, getDialogMessage, getDialogTitle, getNegativeButtonText, getPositiveButtonText, onActivityDestroy, onBindDialogView, onClick, onClick, onCreateDialogView, onDialogClosed, onDismiss, setDialogIcon, setDialogIcon, setDialogLayoutResource, setDialogMessage, setDialogMessage, setDialogTitle, setDialogTitle, setNegativeButtonText, setNegativeButtonText, setPositiveButtonText, setPositiveButtonText, showDialog
callChangeListener, compareTo, findPreferenceInHierarchy, getContext, getDependency, getEditor, getExtras, getFragment, getIcon, getIntent, getKey, getLayoutResource, getOnPreferenceChangeListener, getOnPreferenceClickListener, getOrder, getParent, getPersistedBoolean, getPersistedFloat, getPersistedInt, getPersistedLong, getPersistedString, getPersistedStringSet, getPreferenceDataStore, getPreferenceManager, getSharedPreferences, getShouldDisableView, getTitle, getTitleRes, getView, getWidgetLayoutResource, hasKey, isEnabled, isIconSpaceReserved, isPersistent, isRecycleEnabled, isSelectable, isSingleLineTitle, notifyChanged, notifyDependencyChange, notifyHierarchyChanged, onAttachedToActivity, onAttachedToHierarchy, onBindView, onCreateView, onDependencyChanged, onParentChanged, onPrepareForRemoval, peekExtras, persistBoolean, persistFloat, persistInt, persistLong, persistString, persistStringSet, restoreHierarchyState, saveHierarchyState, setDefaultValue, setDependency, setEnabled, setFragment, setIcon, setIcon, setIconSpaceReserved, setIntent, setKey, setLayoutResource, setOnPreferenceChangeListener, setOnPreferenceClickListener, setOrder, setPersistent, setPreferenceDataStore, setRecycleEnabled, setSelectable, setShouldDisableView, setSingleLineTitle, setSummary, setSummary, setTitle, setTitle, setWidgetLayoutResource, shouldCommit, shouldDisableDependents, shouldPersist, toString
public ListDialogPreference(android.content.Context context, android.util.AttributeSet attrs)
public void setOnValueChangedListener(ListDialogPreference.OnValueChangedListener listener)
listener
- the listener to invokepublic void setListItemLayoutResource(int layoutResId)
layoutResId
- the layout to use for displaying grid itemspublic void setValues(int[] values)
values
- the list of item valuespublic void setTitles(java.lang.CharSequence[] titles)
titles
- the list of item titlesprotected abstract void onBindListItem(android.view.View view, int index)
view
- the view to populateindex
- the index for which to populate the viewsetListItemLayoutResource(int)
,
getValueAt(int)
,
getTitleAt(int)
protected java.lang.CharSequence getTitleAt(int index)
protected int getValueAt(int index)
public java.lang.CharSequence getSummary()
getSummary
in class android.preference.Preference
protected void onPrepareDialogBuilder(android.app.AlertDialog.Builder builder)
onPrepareDialogBuilder
in class android.preference.DialogPreference
protected int getIndexForValue(int value)
AdapterView.INVALID_POSITION
if not foundpublic void setValue(int value)
value
- the value to setpublic int getValue()
protected java.lang.Object onGetDefaultValue(android.content.res.TypedArray a, int index)
onGetDefaultValue
in class android.preference.Preference
protected void onSetInitialValue(boolean restoreValue, java.lang.Object defaultValue)
onSetInitialValue
in class android.preference.Preference
protected android.os.Parcelable onSaveInstanceState()
onSaveInstanceState
in class android.preference.DialogPreference
protected void onRestoreInstanceState(android.os.Parcelable state)
onRestoreInstanceState
in class android.preference.DialogPreference