public class ColorPaletteAdapter
extends android.widget.BaseAdapter
GridView widget.| Constructor and Description |
|---|
ColorPaletteAdapter(android.content.Context context,
int[] colorPalette,
int previewSize,
AbstractColorPickerPreference.PreviewShape previewShape,
int previewBorderWidth,
int previewBorderColor,
android.graphics.drawable.Drawable previewBackground)
Creates a new adapter, which provides colors for visualization using a
GridView
widget. |
| Modifier and Type | Method and Description |
|---|---|
int |
getCount() |
java.lang.Integer |
getItem(int position) |
long |
getItemId(int position) |
android.view.View |
getView(int position,
android.view.View convertView,
android.view.ViewGroup parent) |
int |
indexOf(int color)
Returns the index of a specific color.
|
public ColorPaletteAdapter(android.content.Context context,
int[] colorPalette,
int previewSize,
AbstractColorPickerPreference.PreviewShape previewShape,
int previewBorderWidth,
int previewBorderColor,
android.graphics.drawable.Drawable previewBackground)
GridView
widget.context - The context, which should be used by the adapter, as an instance of the class Context. The context may not be nullcolorPalette - The color palette, which should be provided by the adapter, as an Integer
array. The color palette may not be nullpreviewSize - The size, which should be used to preview colors, as an Integer value in
pixels. The size must be at least 1previewShape - The shape, which should be used to preview colors, as a value of the enum AbstractColorPickerPreference.PreviewShape. The shape may not be nullpreviewBorderWidth - The border width, which should be used to preview colors, as an Integer
value. The border width must be at least 0previewBorderColor - The border color, which should be used to preview colors, as an Integer
valuepreviewBackground - The background, which should be used to preview colors, as an instance of the class
Drawable or null, if no background should be shownpublic final int indexOf(int color)
color - The color, whose index should be returned, as an Integer valuepublic final int getCount()
public final java.lang.Integer getItem(int position)
public final long getItemId(int position)
public final android.view.View getView(int position,
android.view.View convertView,
android.view.ViewGroup parent)