SeekBarPreference
public
class
SeekBarPreference
extends Preference
| java.lang.Object | ||
| ↳ | androidx.preference.Preference | |
| ↳ | androidx.preference.SeekBarPreference | |
Preference based on android.preference.SeekBarPreference but uses support preference as a base
. It contains a title and a SeekBar and an optional SeekBar value TextView.
The actual preference layout is customizable by setting android:layout on the
preference widget layout or seekBarPreferenceStyle attribute.
The SeekBar within the preference can be defined adjustable or not by setting adjustable attribute. If adjustable, the preference will be responsive to DPAD left/right keys.
Otherwise, it skips those keys.
The SeekBar value view can be shown or disabled by setting showSeekBarValue
attribute to true or false, respectively.
Other SeekBar specific attributes (e.g. title, summary, defaultValue, min,
max)
can be set directly on the preference widget layout.
Summary
Inherited constants |
|---|
Public constructors | |
|---|---|
SeekBarPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
|
|
SeekBarPreference(Context context, AttributeSet attrs, int defStyleAttr)
|
|
SeekBarPreference(Context context, AttributeSet attrs)
|
|
SeekBarPreference(Context context)
|
|
Public methods | |
|---|---|
int
|
getMax()
Gets the upper bound set on the |
int
|
getMin()
Gets the lower bound set on the |
final
int
|
getSeekBarIncrement()
Returns the amount of increment change via each arrow key click. |
boolean
|
getShowSeekBarValue()
Gets whether the current |
boolean
|
getUpdatesContinuously()
Gets whether the |
int
|
getValue()
Gets the current progress of the |
boolean
|
isAdjustable()
Gets whether the |
void
|
onBindViewHolder(PreferenceViewHolder holder)
Binds the created View to the data for this preference. |
void
|
setAdjustable(boolean adjustable)
Sets whether the |
final
void
|
setMax(int max)
Sets the upper bound on the |
void
|
setMin(int min)
Sets the lower bound on the |
final
void
|
setSeekBarIncrement(int seekBarIncrement)
Sets the increment amount on the |
void
|
setShowSeekBarValue(boolean showSeekBarValue)
Sets whether the current |
void
|
setUpdatesContinuously(boolean updatesContinuously)
Sets whether the |
void
|
setValue(int seekBarValue)
Sets the current progress of the |
Protected methods | |
|---|---|
Object
|
onGetDefaultValue(TypedArray a, int index)
Called when a preference is being inflated and the default value attribute needs to be read. |
void
|
onRestoreInstanceState(Parcelable state)
Hook allowing a preference to re-apply a representation of its internal state that had
previously been generated by |
Parcelable
|
onSaveInstanceState()
Hook allowing a preference to generate a representation of its internal state that can later be used to create a new instance with that same state. |
void
|
onSetInitialValue(Object defaultValue)
Implement this to set the initial value of the preference. |
Inherited methods | |
|---|---|