public abstract class AbstractColorPickerPreference extends DialogPreference
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractColorPickerPreference.ColorFormat
The formats, which are supported to print textual representations of colors.
|
static class |
AbstractColorPickerPreference.PreviewShape
Contains all shapes, which can be used to show previews of colors.
|
static class |
AbstractColorPickerPreference.SavedState
A data structure, which allows to save the internal state of an
AbstractColorPickerPreference. |
| Constructor and Description |
|---|
AbstractColorPickerPreference(android.content.Context context)
Creates a new preference, which allows to choose a color.
|
AbstractColorPickerPreference(android.content.Context context,
android.util.AttributeSet attributeSet)
Creates a new preference, which allows to choose a color.
|
AbstractColorPickerPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle)
Creates a new preference, which allows to choose a color.
|
AbstractColorPickerPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle,
int defaultStyleResource)
Creates a new preference, which allows to choose a color.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getColor()
Returns the currently persisted color of the preference.
|
AbstractColorPickerPreference.ColorFormat |
getColorFormat()
Returns the format, which is used to print a textual representation of the preference's
color.
|
android.graphics.drawable.Drawable |
getPreviewBackground()
Returns the background of the preview of the preference's color.
|
int |
getPreviewBorderColor()
Returns the border color of the preview of the preference's color.
|
int |
getPreviewBorderWidth()
Returns the border width of the preview of the preference's color.
|
AbstractColorPickerPreference.PreviewShape |
getPreviewShape()
Returns the shape of the preview of the preference's color.
|
int |
getPreviewSize()
Returns the size of the preview of the preference's color.
|
java.lang.CharSequence |
getSummary() |
boolean |
isPreviewShown()
Returns, whether a preview of the preference's color is shown, or not.
|
void |
onBindViewHolder(PreferenceViewHolder holder) |
protected java.lang.Object |
onGetDefaultValue(android.content.res.TypedArray typedArray,
int index) |
protected void |
onRestoreInstanceState(android.os.Parcelable state) |
protected android.os.Parcelable |
onSaveInstanceState() |
protected void |
onSetInitialValue(java.lang.Object defaultValue) |
void |
setColor(int color)
Sets the current color of the preference.
|
void |
setColorFormat(AbstractColorPickerPreference.ColorFormat colorFormat)
Sets the format, which should be used to print a textual representation of the preference's
color.
|
void |
setPreviewBackground(android.graphics.drawable.Drawable background)
Sets the background of the preview of the preference's color.
|
void |
setPreviewBackground(int resourceId)
Sets the background of the preview of the preference's color.
|
void |
setPreviewBackgroundColor(int backgroundColor)
Sets the background color of the preview of the preference's color.
|
void |
setPreviewBorderColor(int borderColor)
Sets the border color of the preview of the preference's color.
|
void |
setPreviewBorderWidth(int borderWidth)
Sets the border width of the preview of the preference's color.
|
void |
setPreviewShape(AbstractColorPickerPreference.PreviewShape previewShape)
Sets the shape of the preview of the preference's color.
|
void |
setPreviewSize(int previewSize)
Sets the size of the preview of the preference's color.
|
void |
showPreview(boolean showPreview)
Sets, whether a preview of the preference's color 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, onDialogClosed, onDismiss, onKey, onPrepareDialog, 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 AbstractColorPickerPreference(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 AbstractColorPickerPreference(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 AbstractColorPickerPreference(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 AbstractColorPickerPreference(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 final int getColor()
Integer valuepublic final void setColor(int color)
color - The color, which should be set, as an Integer valuepublic final boolean isPreviewShown()
public final void showPreview(boolean showPreview)
showPreview - True, if a preview of the preference's color should be shown, false otherwisepublic final int getPreviewSize()
Integer value in
pixelspublic final void setPreviewSize(int previewSize)
previewSize - The size, which should be set, as an Integer value in pixels. The size must
be at least 1public final AbstractColorPickerPreference.PreviewShape getPreviewShape()
AbstractColorPickerPreference.PreviewShape. The shape may either be CIRCLE or SQUAREpublic final void setPreviewShape(AbstractColorPickerPreference.PreviewShape previewShape)
previewShape - The shape, which should be set, as a value of the enum AbstractColorPickerPreference.PreviewShape. The
shape may not be nullpublic final int getPreviewBorderWidth()
Integer value
in pixelspublic final void setPreviewBorderWidth(int borderWidth)
borderWidth - The border width, which should be set, as an Integer value in pixels. The
border width must be at least 0public final int getPreviewBorderColor()
Integer valuepublic final void setPreviewBorderColor(int borderColor)
borderColor - The border color, which should be set, as an Integer valuepublic final android.graphics.drawable.Drawable getPreviewBackground()
Drawablepublic final void setPreviewBackground(android.graphics.drawable.Drawable background)
background - The background, which should be set, as an instance of the class Drawable or
null, if no background should be shownpublic final void setPreviewBackground(int resourceId)
resourceId - The resource id of the background, which should be set, as an Integer value.
The resource id must correspond to a valid drawable resourcepublic final void setPreviewBackgroundColor(int backgroundColor)
backgroundColor - The background color, which should be set, as an Integer valuepublic final AbstractColorPickerPreference.ColorFormat getColorFormat()
AbstractColorPickerPreference.ColorFormat. The format may either be
RGB,
ARGB, HEX or AHEXpublic final void setColorFormat(AbstractColorPickerPreference.ColorFormat colorFormat)
colorFormat - The format, which should be set, as a value of the enum AbstractColorPickerPreference.ColorFormat. The
format may not be nullpublic final java.lang.CharSequence getSummary()
protected final java.lang.Object onGetDefaultValue(android.content.res.TypedArray typedArray,
int index)
protected final void onSetInitialValue(java.lang.Object defaultValue)
public void onBindViewHolder(PreferenceViewHolder holder)
protected android.os.Parcelable onSaveInstanceState()
onSaveInstanceState in class DialogPreferenceprotected void onRestoreInstanceState(android.os.Parcelable state)
onRestoreInstanceState in class DialogPreference