public class NumberPickerPreference extends AbstractNumberPickerPreference
NumberPicker widget. The
chosen number will only be persisted, if confirmed by the user.| Modifier and Type | Class and Description |
|---|---|
static class |
NumberPickerPreference.SavedState
A data structure, which allows to save the internal state of an
NumberPickerPreference. |
| Constructor and Description |
|---|
NumberPickerPreference(android.content.Context context)
Creates a new preference, which allows to choose a decimal number via a
NumberPicker
widget. |
NumberPickerPreference(android.content.Context context,
android.util.AttributeSet attributeSet)
Creates a new preference, which allows to choose a decimal number via a
NumberPicker
widget. |
NumberPickerPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle)
Creates a new preference, which allows to choose a decimal number via a
NumberPicker
widget. |
NumberPickerPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle,
int defaultStyleResource)
Creates a new preference, which allows to choose a decimal number via a
NumberPicker
widget. |
| Modifier and Type | Method and Description |
|---|---|
protected int |
getCurrentIndex()
Returns the currently selected index of the
NumberPicker widget. |
int |
getMaxNumber()
Returns the maximum number, the preference allows to choose.
|
int |
getMinNumber()
Returns the minimum number, the preference allows to choose.
|
int |
getRange()
Returns the range of numbers, the preference allows to choose from.
|
int |
getStepSize()
Returns the step size, the number is increased or decreased by when moving the selector
wheel.
|
protected void |
onDialogClosed(AbstractButtonBarDialog dialog,
boolean positiveResult)
The method, which is invoked on subclasses when the preference's dialog has been closed.
|
protected void |
onPrepareDialog(<any> dialogBuilder)
The method, which is invoked on subclasses when the preference's dialog is about to be
created.
|
protected void |
onRestoreInstanceState(android.os.Parcelable state) |
protected android.os.Parcelable |
onSaveInstanceState() |
void |
setMaxNumber(int maxNumber)
Sets the maximum number, the preference allows to choose.
|
void |
setMinNumber(int minNumber)
Sets the minimum number, the preference allows to choose.
|
void |
setNumber(int number)
Sets the current number of the preference.
|
void |
setStepSize(int stepSize)
Sets the step size, the number should be increased or decreased by when moving the selector
wheel.
|
void |
useInputMethod(boolean useInputMethod)
Sets, whether an input method should be used by the preference, or not.
|
void |
wrapSelectorWheel(boolean wrapSelectorWheel)
Sets, whether the selector wheel of the preference's
NumberPicker should be wrapped,
or not. |
getNumber, getSummary, getUnit, isInputMethodUsed, isSelectorWheelWrapped, needInputMethod, onGetDefaultValue, onSetInitialValue, setUnit, setUnitareDialogDividersShownOnScroll, createDialog, createDialogBuilder, getDialog, getDialogBackground, getDialogBottomMargin, getDialogButtonTextColor, getDialogButtonTypeface, getDialogCancelAnimation, getDialogDismissAnimation, getDialogDividerColor, getDialogDividerMargin, getDialogGravity, getDialogHeaderBackground, getDialogHeaderIcon, getDialogHeaderIconTintList, getDialogHeaderIconTintMode, getDialogHeight, getDialogIcon, getDialogIconTintList, getDialogIconTintMode, getDialogLeftMargin, getDialogMaxHeight, getDialogMaxWidth, getDialogMessage, getDialogMessageColor, getDialogMessageTypeface, getDialogPaddingBottom, getDialogPaddingLeft, getDialogPaddingRight, getDialogPaddingTop, getDialogRightMargin, getDialogScrollableArea, getDialogShowAnimation, getDialogTitle, getDialogTitleColor, getDialogTitleTypeface, getDialogTopMargin, getDialogWidth, getDialogWindowBackground, getNegativeButtonText, getPositiveButtonText, isDialogButtonBarDividerShown, isDialogFitsSystemWindowsBottom, isDialogFitsSystemWindowsLeft, isDialogFitsSystemWindowsRight, isDialogFitsSystemWindowsTop, isDialogFullscreen, isDialogHeaderShown, isDialogShown, isValueShownAsSummary, onCancel, onClick, onClick, onDismiss, onKey, onShow, performClick, setCustomDialogButtonBar, setCustomDialogButtonBar, setCustomDialogHeader, setCustomDialogHeader, setCustomDialogMessage, setCustomDialogMessage, setCustomDialogTitle, setCustomDialogTitle, setDialogBackground, setDialogBackground, setDialogBackgroundColor, setDialogButtonTextColor, setDialogButtonTextColor, setDialogButtonTypeface, setDialogCancelAnimation, setDialogDismissAnimation, setDialogDividerColor, setDialogDividerMargin, setDialogFitsSystemWindows, setDialogFitsSystemWindows, setDialogFullscreen, setDialogGravity, setDialogHeaderBackground, setDialogHeaderBackground, setDialogHeaderBackgroundColor, setDialogHeaderIcon, setDialogHeaderIcon, setDialogHeaderIconTint, setDialogHeaderIconTintList, setDialogHeaderIconTintMode, setDialogHeight, setDialogIcon, setDialogIcon, setDialogIconTint, setDialogIconTintList, setDialogIconTintMode, setDialogMargin, setDialogMaxHeight, setDialogMaxWidth, setDialogMessage, setDialogMessage, setDialogMessageColor, setDialogMessageTypeface, setDialogPadding, setDialogScrollableArea, setDialogScrollableArea, setDialogShowAnimation, setDialogTitle, setDialogTitle, setDialogTitleColor, setDialogTitleTypeface, setDialogWidth, setDialogWindowBackground, setDialogWindowBackground, setNegativeButtonText, setNegativeButtonText, setOnCancelListener, setOnClickListener, setOnDismissListener, setOnKeyListener, setOnShowListener, setPositiveButtonText, setPositiveButtonText, showDialogButtonBarDivider, showDialogDividersOnScroll, showDialogHeader, showValueAsSummarygetIconTintList, getIconTintMode, setIcon, setIconTint, setIconTintList, setIconTintModepublic NumberPickerPreference(android.content.Context context)
NumberPicker
widget.context - The context, which should be used by the preference, as an instance of the class
Context. The context may not be nullpublic NumberPickerPreference(android.content.Context context,
android.util.AttributeSet attributeSet)
NumberPicker
widget.context - The context, which should be used by the preference, as an instance of the class
Context. The context may not be nullattributeSet - The attributes of the XML tag that is inflating the preference, as an instance of the
type AttributeSet or null, if no attributes are availablepublic NumberPickerPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle)
NumberPicker
widget.context - The context, which should be used by the preference, as an instance of the class
Context. The context may not be nullattributeSet - The attributes of the XML tag that is inflating the preference, as an instance of the
type AttributeSet or null, if no attributes are availabledefaultStyle - The default style to apply to this preference. If 0, no style will be applied (beyond
what is included in the theme). This may either be an attribute resource, whose value
will be retrieved from the current theme, or an explicit style resourcepublic NumberPickerPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle,
int defaultStyleResource)
NumberPicker
widget.context - The context, which should be used by the preference, as an instance of the class
Context. The context may not be nullattributeSet - The attributes of the XML tag that is inflating the preference, as an instance of the
type AttributeSet or null, if no attributes are availabledefaultStyle - The default style to apply to this preference. If 0, no style will be applied (beyond
what is included in the theme). This may either be an attribute resource, whose value
will be retrieved from the current theme, or an explicit style resourcedefaultStyleResource - A resource identifier of a style resource that supplies default values for the
preference, used only if the default style is 0 or can not be found in the theme. Can
be 0 to not look for defaultsprotected final int getCurrentIndex()
NumberPicker widget.NumberPicker widget as an Integer
valuepublic final int getMinNumber()
Integer valuepublic final void setMinNumber(int minNumber)
minNumber - The minimum number, which should be set, as an Integer value. The number must
be less than the maximum numberpublic final int getMaxNumber()
Integer valuepublic final void setMaxNumber(int maxNumber)
maxNumber - The maximum number, which should be set, as an Integer value. The number must
be greater than the minimum numberpublic final int getRange()
Integer
valuepublic final int getStepSize()
Integer valuepublic final void setStepSize(int stepSize)
stepSize - The step size, which should be set, as an Integer value. The value must be
between at least 1 and at maximum the value of the method
getRange():intpublic final void setNumber(int number)
AbstractNumberPickerPreferencesetNumber in class AbstractNumberPickerPreferencenumber - The number, which should be set, as an Integer valuepublic final void useInputMethod(boolean useInputMethod)
AbstractNumberPickerPreferenceuseInputMethod in class AbstractNumberPickerPreferenceuseInputMethod - True, if an input method should be used, false otherwisepublic final void wrapSelectorWheel(boolean wrapSelectorWheel)
AbstractNumberPickerPreferenceNumberPicker should be wrapped,
or not.wrapSelectorWheel in class AbstractNumberPickerPreferencewrapSelectorWheel - True, if the selector wheel of the preference's NumberPicker should be
wrapped, false otherwiseprotected void onPrepareDialog(<any> dialogBuilder)
DialogPreferenceonPrepareDialog in class DialogPreferencedialogBuilder - The builder, which is used to create the preference's dialog, as an instance of the
class AbstractMaterialDialogBuilderprotected void onDialogClosed(AbstractButtonBarDialog dialog,
boolean positiveResult)
DialogPreferenceonDialogClosed in class DialogPreferencedialog - The dialog, which has been closed, as an instance of the class
AbstractButtonBarDialog. The dialog may not be nullpositiveResult - True, if the dialog has been close affirmatively, false otherwiseprotected android.os.Parcelable onSaveInstanceState()
onSaveInstanceState in class AbstractNumberPickerPreferenceprotected void onRestoreInstanceState(android.os.Parcelable state)
onRestoreInstanceState in class AbstractNumberPickerPreference