public class SettingSeekBarPreference extends SettingPreference
SettingPreference implementation that provides SeekBar widget with its related
functionality.
This preference implementation by default displays the preferred progress via SeekBar
widget in the area of the standard summary text (instead of it). The preferred progress may be
specified via setProgress(int) and obtained via getProgress(). Also the maximum
progress value that should be handled by the associated SeekBar widget may be specified via
setMaxProgress(int).
Integer. See TypedArray.getInt(int, int).
SettingPreference,
SettingSeekBarPreference Attributes
uiSettingSeekBarPreferenceStyle| Constructor and Description |
|---|
SettingSeekBarPreference(android.content.Context context)
Same as
SettingSeekBarPreference(Context, AttributeSet) without attributes. |
SettingSeekBarPreference(android.content.Context context,
android.util.AttributeSet attrs)
Same as
SettingSeekBarPreference(Context, AttributeSet, int) with
R.attr#uiSettingSeekBarPreferenceStyle as attribute for default style. |
SettingSeekBarPreference(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr)
Same as
SettingSeekBarPreference(Context, AttributeSet, int, int) with 0
as default style. |
SettingSeekBarPreference(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr,
int defStyleRes)
Creates a new instance of SettingSeekBarPreference for the given context.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getMaxProgress()
Returns the maximum value for progress specified for this preference.
|
int |
getProgress()
Returns the preferred progress value of this preference.
|
void |
onBindView(android.view.View view) |
protected Object |
onGetDefaultValue(android.content.res.TypedArray attributes,
int index) |
protected void |
onSetInitialValue(boolean restorePersistedValue,
Object defaultValue) |
void |
setMaxProgress(int maxProgress)
Sets a maximum value for the progress that may be specified for this preference.
|
void |
setProgress(int progress)
Sets a preferred progress value for this preference.
|
setKeycallChangeListener, compareTo, findPreferenceInHierarchy, getContext, getDependency, getEditor, getExtras, getFragment, getIcon, getIntent, getKey, getLayoutResource, getOnPreferenceChangeListener, getOnPreferenceClickListener, getOrder, getPersistedBoolean, getPersistedFloat, getPersistedInt, getPersistedLong, getPersistedString, getPersistedStringSet, getPreferenceManager, getSharedPreferences, getShouldDisableView, getSummary, getTitle, getTitleRes, getView, getWidgetLayoutResource, hasKey, isEnabled, isPersistent, isSelectable, notifyChanged, notifyDependencyChange, notifyHierarchyChanged, onAttachedToActivity, onAttachedToHierarchy, onClick, onCreateView, onDependencyChanged, onParentChanged, onPrepareForRemoval, onRestoreInstanceState, onSaveInstanceState, peekExtras, persistBoolean, persistFloat, persistInt, persistLong, persistString, persistStringSet, restoreHierarchyState, saveHierarchyState, setDefaultValue, setDependency, setEnabled, setFragment, setIcon, setIcon, setIntent, setLayoutResource, setOnPreferenceChangeListener, setOnPreferenceClickListener, setOrder, setPersistent, setSelectable, setShouldDisableView, setSummary, setSummary, setTitle, setTitle, setWidgetLayoutResource, shouldCommit, shouldDisableDependents, shouldPersist, toStringpublic SettingSeekBarPreference(android.content.Context context)
SettingSeekBarPreference(Context, AttributeSet) without attributes.public SettingSeekBarPreference(android.content.Context context,
android.util.AttributeSet attrs)
SettingSeekBarPreference(Context, AttributeSet, int) with
R.attr#uiSettingSeekBarPreferenceStyle as attribute for default style.public SettingSeekBarPreference(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr)
SettingSeekBarPreference(Context, AttributeSet, int, int) with 0
as default style.public SettingSeekBarPreference(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr,
int defStyleRes)
context - Context in which will be the new setting preference presented.attrs - Set of Xml attributes used to configure the new instance of this preference.defStyleAttr - An attribute which contains a reference to a default style resource for
this preference within a theme of the given context.defStyleRes - Resource id of the default style for the new preference.protected Object onGetDefaultValue(android.content.res.TypedArray attributes, int index)
onGetDefaultValue in class android.preference.Preferenceprotected void onSetInitialValue(boolean restorePersistedValue,
Object defaultValue)
onSetInitialValue in class android.preference.Preferencepublic void setMaxProgress(int maxProgress)
Note, that this value is not used to ensure that the progress specified via setProgress(int)
is in bounds of the maximum progress value, but only for purpose of AbsSeekBar.setMax(int).
maxProgress - The desired maximum progress value.R.attr.max,
getMaxProgress()public int getMaxProgress()
setMaxProgress(int)public void setProgress(int progress)
If value of this preference changes, it is persisted and the change listener is notified about the change.
progress - The preferred progress to be persisted. Should be from the range [0, getMaxProgress()].getProgress()public int getProgress()
setProgress(int)public void onBindView(android.view.View view)
onBindView in class SettingPreference