public class ColorPreviewLoader extends AbstractDataLoader<android.graphics.Bitmap,java.lang.Integer,android.widget.ImageView,java.lang.Void>
| Constructor and Description |
|---|
ColorPreviewLoader(android.content.Context context,
android.graphics.drawable.Drawable background,
AbstractColorPickerPreference.PreviewShape shape,
int size,
int borderWidth,
int borderColor)
Creates a new data loader, which allows to create previews of colors.
|
| Modifier and Type | Method and Description |
|---|---|
android.graphics.drawable.Drawable |
getBackground()
Returns the background of the preview.
|
int |
getBorderColor()
Returns the border color of the preview.
|
int |
getBorderWidth()
Returns the border width of the preview.
|
AbstractColorPickerPreference.PreviewShape |
getShape()
Returns the shape of the preview.
|
int |
getSize()
Returns the size of the preview.
|
protected android.graphics.Bitmap |
loadData(java.lang.Integer color,
java.lang.Void... params)
The method, which is invoked on implementing subclasses, in order to load the data, which
corresponds to a specific key.
|
void |
setBackground(android.graphics.drawable.Drawable background)
Sets the background of the preview.
|
void |
setBorderColor(int borderColor)
Sets the border color of the preview.
|
void |
setBorderWidth(int borderWidth)
Sets the border width of the preview.
|
void |
setShape(AbstractColorPickerPreference.PreviewShape shape)
Sets the shape of the preview.
|
void |
setSize(int size)
Sets the size of the preview.
|
protected void |
showData(android.widget.ImageView imageView,
android.graphics.Bitmap preview)
The method, which is invoked on implementing subclasses, in order to show data after it has
been loaded.
|
getContext, loadpublic ColorPreviewLoader(android.content.Context context,
android.graphics.drawable.Drawable background,
AbstractColorPickerPreference.PreviewShape shape,
int size,
int borderWidth,
int borderColor)
context - The context, which should be used by the data loader, as an instance of the class
Context. The context may not be nullbackground - The background of the preview as an instance of the class Drawable or null,
if no background should be shownshape - The shape of the preview as a value of the enum AbstractColorPickerPreference.PreviewShape. The shape may
not be nullsize - The size of the preview as an Integer value in pixels. The size must be at
least 1borderWidth - The border width of the preview as an Integer value in pixels. The border
width must be at least 0borderColor - The border color of the preview as an Integer valuepublic final android.graphics.drawable.Drawable getBackground()
Drawablepublic final void setBackground(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 AbstractColorPickerPreference.PreviewShape getShape()
AbstractColorPickerPreference.PreviewShape. The shape may
either be CIRCLE or SQUAREpublic final void setShape(AbstractColorPickerPreference.PreviewShape shape)
shape - The shape, which should be set, as a value of the enum AbstractColorPickerPreference.PreviewShape. The
shape may not be nullpublic final int getSize()
Integer value in pixelspublic final void setSize(int size)
size - The size, which should be set, as an Integer value in pixels. The size must
be at least 1public final int getBorderWidth()
Integer value in pixelspublic final void setBorderWidth(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 getBorderColor()
Integer valuepublic final void setBorderColor(int borderColor)
borderColor - The border color, which should be set, as an Integer valueprotected final android.graphics.Bitmap loadData(java.lang.Integer color,
java.lang.Void... params)
AbstractDataLoaderloadData in class AbstractDataLoader<android.graphics.Bitmap,java.lang.Integer,android.widget.ImageView,java.lang.Void>color - The key of the data, which should be loaded, as an instance of the generic type
KeyType. The key may not be nullparams - An array, which may contain optional parameters, as an array of the generic type
ParamTypeprotected final void showData(android.widget.ImageView imageView,
android.graphics.Bitmap preview)
AbstractDataLoadershowData in class AbstractDataLoader<android.graphics.Bitmap,java.lang.Integer,android.widget.ImageView,java.lang.Void>imageView - The view, which should be used to show the data after it has been loaded, as an
instance of the generic type ViewType. The view may not be nullpreview - The data, which should be shown, as an instance of the generic type DataType. The
data may not be null