public class SeekBarPreference extends DialogPreference
| Modifier and Type | Class and Description |
|---|---|
static class |
SeekBarPreference.SavedState
A data structure, which allows to save the internal state of a
SeekBarPreference. |
| Constructor and Description |
|---|
SeekBarPreference(android.content.Context context)
Creates a new preference, which allows to select a value from a continuous range via a seek
bar.
|
SeekBarPreference(android.content.Context context,
android.util.AttributeSet attributeSet)
Creates a new preference, which allows to select a value from a continuous range via a seek
bar.
|
SeekBarPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle)
Creates a new preference, which allows to select a value from a continuous range via a seek
bar.
|
SeekBarPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle,
int defaultStyleResource)
Creates a new preference, which allows to select a value from a continuous range via a seek
bar.
|
| Modifier and Type | Method and Description |
|---|---|
protected float |
getCurrentValue()
Returns the current value of the seek bar.
|
int |
getDecimals()
Returns the number of decimals of the floating point numbers, the preference allows to
choose.
|
java.lang.CharSequence |
getFloatingPointSeparator()
Returns the symbol, which is used to separate floating point numbers for textual
representation.
|
int |
getMaxValue()
Returns the maximum value, the preference allows to choose.
|
int |
getMinValue()
Returns the minimum value, the preference allows to choose.
|
int |
getRange()
Returns the range of values, the preference allows to choose from.
|
int |
getStepSize()
Returns the step size, the value is increased or decreased by, when moving the seek bar.
|
java.lang.CharSequence[] |
getSummaries()
Returns the summaries, which are shown depending on the currently persisted value.
|
java.lang.CharSequence |
getSummary() |
java.lang.CharSequence |
getUnit()
Returns the unit, which is used for textual representation of the preference's value.
|
float |
getValue()
Returns the currently persisted value of the preference.
|
boolean |
isProgressShown()
Returns, whether the currently selected value of the seek bar is shown, or not.
|
protected void |
onDialogClosed(AbstractButtonBarDialog dialog,
boolean positiveResult)
The method, which is invoked on subclasses when the preference's dialog has been closed.
|
protected java.lang.Object |
onGetDefaultValue(android.content.res.TypedArray a,
int index) |
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() |
protected void |
onSetInitialValue(java.lang.Object defaultValue) |
void |
setDecimals(int decimals)
Sets the number of decimals of the floating point numbers, the preference should allow to
choose.
|
void |
setFloatingPointSeparator(java.lang.CharSequence floatingPointSeparator)
Sets the symbol, which should be used to separate floating point numbers for textual
representation.
|
void |
setFloatingPointSeparator(int resourceId)
Sets the symbol, which should be used to separate floating point numbers for textual
representation.
|
void |
setMaxValue(int maxValue)
Sets the maximum value, the preference should allow to choose.
|
void |
setMinValue(int minValue)
Sets the minimum value, the preference should allow to choose.
|
void |
setStepSize(int stepSize)
Sets the step size, the value should be increased or decreased by, when moving the seek bar.
|
void |
setSummaries(java.lang.CharSequence[] summaries)
Sets the summaries, which should be shown depending on the currently persisted value.
|
void |
setSummary(java.lang.CharSequence summary) |
void |
setSummary(int resourceId) |
void |
setUnit(java.lang.CharSequence unit)
Sets the unit, which should be used for textual representation of the preference's value.
|
void |
setUnit(int resourceId)
Sets the unit, which should be used for textual representation of the preference's value.
|
void |
setValue(java.lang.Float value)
Sets the current value of the preference.
|
void |
showProgress(boolean showProgress)
Sets, whether the currently selected value of the seek bar should be shown, or not.
|
areDialogDividersShownOnScroll, 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, needInputMethod, 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 SeekBarPreference(android.content.Context context)
context - The context in which to store the preference's value as an instance of the class
Context. The context may not be nullpublic SeekBarPreference(android.content.Context context,
android.util.AttributeSet attributeSet)
context - The Context this preference is associated with and through which it can access the
current theme, resources, SharedPreferences, etc, 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 SeekBarPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle)
context - The context in which to store Preference value as an instance of the class Context. The context may not be nullattributeSet - The attribute set, the preference's attributes should be obtained from, 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 SeekBarPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle,
int defaultStyleResource)
context - The context in which to store Preference value as an instance of the class Context. The context may not be nullattributeSet - The attribute set, the preference's attributes should be obtained from, 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 float getCurrentValue()
Float valuepublic final float getValue()
Float valuepublic final void setValue(java.lang.Float value)
value - The value, which should be set, as a Float value. The value must be between
the minimum and the maximum value, the preference allows to selectpublic final int getMinValue()
Integer valuepublic final void setMinValue(int minValue)
minValue - The minimum value, which should be set, as an Integer value. The value must
be less than the maximum value, the preference allows to choosepublic final int getMaxValue()
Integer valuepublic final void setMaxValue(int maxValue)
maxValue - The maximum value, which should be set, as an Integer value. The value must
be greater than the minimum value, that preference allows to choosepublic 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 at
least 1 and at maximum the value of the method getRange():int or -1, if
the preference should allow to select a value from a continuous rangepublic final int getDecimals()
Integer valuepublic final void setDecimals(int decimals)
decimals - The number of decimals, which should be set, as an Integer value. The value
must be at least 0. If the value is set to 0, the preference will only allow to
choose integer valuespublic final java.lang.CharSequence getUnit()
CharSequence or null, if no unit is usedpublic final void setUnit(java.lang.CharSequence unit)
unit - The unit, which should be set, as an instance of the type CharSequence or
null, if no unit should be usedpublic final void setUnit(int resourceId)
resourceId - The resource id of the unit, which should be set, as an Integer value. The
resource id must correspond to a valid string resourcepublic final java.lang.CharSequence getFloatingPointSeparator()
Character or null, if the default symbol
is usedpublic final void setFloatingPointSeparator(java.lang.CharSequence floatingPointSeparator)
floatingPointSeparator - The symbol, which should be set, as an instance of the type CharSequence or
null, if the default symbol should be used. The length of the symbol must be 1public final void setFloatingPointSeparator(int resourceId)
resourceId - The resource id of the symbol, which should be set, as an Integer value. The
resource id must correspond to a valid string resourcepublic final boolean isProgressShown()
public final void showProgress(boolean showProgress)
showProgress - True, if the currently selected value of the seek bar should be shown, false
otherwisepublic final java.lang.CharSequence[] getSummaries()
CharSequence or null, if no summaries are shown depending on the
currently persisted valuepublic final void setSummaries(java.lang.CharSequence[] summaries)
summaries - The summaries, which should be set, as an array of the type CharSequence or
null, if no summaries should be shown depending on the currently persisted valuepublic final java.lang.CharSequence getSummary()
public final void setSummary(java.lang.CharSequence summary)
public final void setSummary(int resourceId)
protected final java.lang.Object onGetDefaultValue(android.content.res.TypedArray a,
int index)
protected final void onSetInitialValue(java.lang.Object defaultValue)
protected 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 DialogPreferenceprotected void onRestoreInstanceState(android.os.Parcelable state)
onRestoreInstanceState in class DialogPreference