public class ResolutionPreference extends AbstractValidateableDialogPreference<java.lang.CharSequence>
| Modifier and Type | Class and Description |
|---|---|
static class |
ResolutionPreference.SavedState
A data structure, which allows to save the internal state of a
ResolutionPreference. |
| Constructor and Description |
|---|
ResolutionPreference(android.content.Context context)
Creates a new preference, which allows to enter a two-dimensional image or video resolution
via two EditText widgets.
|
ResolutionPreference(android.content.Context context,
android.util.AttributeSet attributeSet)
Creates a new preference, which allows to enter a two-dimensional image or video resolution
via two EditText widgets.
|
ResolutionPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle)
Creates a new preference, which allows to enter a two-dimensional image or video resolution
via two EditText widgets.
|
ResolutionPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle,
int defaultStyleResource)
Creates a new preference, which allows to enter a two-dimensional image or video resolution
via two EditText widgets.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
formatResolution(android.content.Context context,
int width,
int height)
Creates and returns the textual representation of a specific resolution.
|
int |
getHeight()
Returns the height of the currently persisted resolution of the preference.
|
java.lang.CharSequence |
getHeightHint()
Returns the hint of the edit text widget, which allows to enter the height of the
resolution.
|
java.lang.CharSequence |
getSummary() |
java.lang.CharSequence |
getUnit()
Returns the unit, which is used for textual representation of the preference's resolution.
|
int |
getWidth()
Returns the width of the currently persisted resolution of the preference.
|
java.lang.CharSequence |
getWidthHint()
Returns the hint of the edit text widget, which allows to enter the width of the resolution.
|
protected boolean |
needInputMethod()
The method, which is invoked on subclasses to determine, whether the soft input mode should
be requested when the preference's dialog becomes 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 typedArray,
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) |
static android.util.Pair<java.lang.Integer,java.lang.Integer> |
parseResolution(android.content.Context context,
java.lang.String resolution)
Parses a specific textual representation of a resolution and returns its dimensions.
|
void |
setHeightHint(java.lang.CharSequence hint)
Sets the hint of the edit text widget, which allows to enter the height of the resolution.
|
void |
setHeightHint(int resourceId)
Sets the hint of the edit text widget, which allows to enter the height of the resolution.
|
void |
setResolution(int width,
int height)
Sets the current resolution of the preference.
|
void |
setUnit(java.lang.CharSequence unit)
Sets the unit, which should be used for textual representation of the preference's
resolution.
|
void |
setUnit(int resourceId)
Sets the unit, which should be used for textual representation of the preference's
resolution.
|
void |
setWidthHint(java.lang.CharSequence hint)
Sets the hint of the edit text widget, which allows to enter the width of the resolution.
|
void |
setWidthHint(int resourceId)
Sets the hint of the edit text widget, which allows to enter the width of the resolution.
|
boolean |
validate() |
addAllValidators, addAllValidators, addValidationListener, addValidator, getErrorColor, getHelperText, getHelperTextColor, getValidationListeners, getValidators, isValidatedOnFocusLost, isValidatedOnValueChange, removeAllValidators, removeAllValidators, removeAllValidators, removeValidationListener, removeValidator, setErrorColor, setHelperText, setHelperText, setHelperTextColor, validate, validateOnFocusLost, validateOnValueChangeareDialogDividersShownOnScroll, 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 ResolutionPreference(android.content.Context context)
context - The context, which should be used by the preference, as an instance of the class
Context. The context may not be nullpublic ResolutionPreference(android.content.Context context,
android.util.AttributeSet attributeSet)
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 ResolutionPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle)
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 ResolutionPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle,
int defaultStyleResource)
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 defaultspublic static android.util.Pair<java.lang.Integer,java.lang.Integer> parseResolution(android.content.Context context,
java.lang.String resolution)
context - The context, which should be used, as an instance of the class Context. The
context may not be nullresolution - The textual representation of the resolution, which should be parsed, as a String. The resolution may neither be null, nor emptyPairpublic static java.lang.String formatResolution(android.content.Context context,
int width,
int height)
context - The context, which should be used, as an instance of the class Context. The
context may not be nullwidth - The width of the resolution as an Integer value. The width must be at least
1height - The height of the resolution as an Integer value. The height must be at least
1Stringpublic final int getWidth()
Integer valuepublic final int getHeight()
Integer valuepublic final void setResolution(int width,
int height)
width - The width, which should be set, as an Integer value. The width must be at
least 1height - The height, which should be set, as an Integer value. The height must be at
least 1public 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 getWidthHint()
CharSequence or null, if no hint is setpublic final void setWidthHint(java.lang.CharSequence hint)
hint - The hint, which should be set, as an instance of the type CharSequence or
null, if no hint should be setpublic final void setWidthHint(int resourceId)
resourceId - The resource id of the hint, which should be set, as an Integer value. The
resource id must correspond to a valid string resourcepublic final java.lang.CharSequence getHeightHint()
CharSequence or null, if no hint is setpublic final void setHeightHint(java.lang.CharSequence hint)
hint - The hint, which should be set, as an instance of the type CharSequence or
null, if no hint should be setpublic final void setHeightHint(int resourceId)
resourceId - The resource id of the hint, which should be set, as an Integer value. The
resource id must correspond to a valid string resourcepublic final java.lang.CharSequence getSummary()
public final boolean validate()
protected void onPrepareDialog(<any> dialogBuilder)
DialogPreferenceonPrepareDialog in class AbstractValidateableDialogPreference<java.lang.CharSequence>dialogBuilder - 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 final boolean needInputMethod()
DialogPreferenceneedInputMethod in class DialogPreferenceprotected final java.lang.Object onGetDefaultValue(android.content.res.TypedArray typedArray,
int index)
protected final void onSetInitialValue(java.lang.Object defaultValue)
protected android.os.Parcelable onSaveInstanceState()
onSaveInstanceState in class DialogPreferenceprotected void onRestoreInstanceState(android.os.Parcelable state)
onRestoreInstanceState in class DialogPreference