|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkankan.wheel.widget.adapters.AbstractWheelAdapter
kankan.wheel.widget.adapters.AbstractWheelTextAdapter
public abstract class AbstractWheelTextAdapter
Abstract wheel adapter provides common functionality for adapters.
Field Summary | |
---|---|
protected Context |
context
|
static int |
DEFAULT_TEXT_COLOR
Default text color |
static int |
DEFAULT_TEXT_SIZE
Default text size |
protected int |
emptyItemResourceId
|
protected LayoutInflater |
inflater
|
protected int |
itemResourceId
|
protected int |
itemTextResourceId
|
static int |
LABEL_COLOR
Default text color |
protected static int |
NO_RESOURCE
No resource constant. |
static int |
TEXT_VIEW_ITEM_RESOURCE
Text view resource. |
private int |
textColor
|
private int |
textSize
|
Constructor Summary | |
---|---|
protected |
AbstractWheelTextAdapter(Context context)
Constructor |
protected |
AbstractWheelTextAdapter(Context context,
int itemResource)
Constructor |
protected |
AbstractWheelTextAdapter(Context context,
int itemResource,
int itemTextResource)
Constructor |
Method Summary | |
---|---|
protected void |
configureTextView(TextView view)
Configures text view. |
View |
getEmptyItem(View convertView,
ViewGroup parent)
Get a View that displays an empty wheel item placed before the first or after the last wheel item. |
int |
getEmptyItemResource()
Gets resource Id for empty items views |
View |
getItem(int index,
View convertView,
ViewGroup parent)
Get a View that displays the data at the specified position in the data set |
int |
getItemResource()
Gets resource Id for items views |
protected abstract java.lang.CharSequence |
getItemText(int index)
Returns text for specified item |
int |
getItemTextResource()
Gets resource Id for text view in item layout |
int |
getTextColor()
Gets text color |
int |
getTextSize()
Gets text size |
private TextView |
getTextView(View view,
int textResource)
Loads a text view from view |
private View |
getView(int resource,
ViewGroup parent)
Loads view from resources |
void |
setEmptyItemResource(int emptyItemResourceId)
Sets resource Id for empty items views |
void |
setItemResource(int itemResourceId)
Sets resource Id for items views |
void |
setItemTextResource(int itemTextResourceId)
Sets resource Id for text view in item layout |
void |
setTextColor(int textColor)
Sets text color |
void |
setTextSize(int textSize)
Sets text size |
Methods inherited from class kankan.wheel.widget.adapters.AbstractWheelAdapter |
---|
notifyDataChangedEvent, notifyDataInvalidatedEvent, registerDataSetObserver, unregisterDataSetObserver |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface kankan.wheel.widget.adapters.WheelViewAdapter |
---|
getItemsCount |
Field Detail |
---|
public static final int TEXT_VIEW_ITEM_RESOURCE
protected static final int NO_RESOURCE
public static final int DEFAULT_TEXT_COLOR
public static final int LABEL_COLOR
public static final int DEFAULT_TEXT_SIZE
private int textColor
private int textSize
protected Context context
protected LayoutInflater inflater
protected int itemResourceId
protected int itemTextResourceId
protected int emptyItemResourceId
Constructor Detail |
---|
protected AbstractWheelTextAdapter(Context context)
context
- the current contextprotected AbstractWheelTextAdapter(Context context, int itemResource)
context
- the current contextitemResource
- the resource ID for a layout file containing a TextView to use when instantiating items viewsprotected AbstractWheelTextAdapter(Context context, int itemResource, int itemTextResource)
context
- the current contextitemResource
- the resource ID for a layout file containing a TextView to use when instantiating items viewsitemTextResource
- the resource ID for a text view in the item layoutMethod Detail |
---|
public int getTextColor()
public void setTextColor(int textColor)
textColor
- the text color to setpublic int getTextSize()
public void setTextSize(int textSize)
textSize
- the text size to setpublic int getItemResource()
public void setItemResource(int itemResourceId)
itemResourceId
- the resource Id to setpublic int getItemTextResource()
public void setItemTextResource(int itemTextResourceId)
itemTextResourceId
- the item text resource Id to setpublic int getEmptyItemResource()
public void setEmptyItemResource(int emptyItemResourceId)
emptyItemResourceId
- the empty item resource Id to setprotected abstract java.lang.CharSequence getItemText(int index)
index
- the item index
public View getItem(int index, View convertView, ViewGroup parent)
WheelViewAdapter
index
- the item indexconvertView
- the old view to reuse if possibleparent
- the parent that this view will eventually be attached to
public View getEmptyItem(View convertView, ViewGroup parent)
WheelViewAdapter
getEmptyItem
in interface WheelViewAdapter
getEmptyItem
in class AbstractWheelAdapter
convertView
- the old view to reuse if possibleparent
- the parent that this view will eventually be attached to
protected void configureTextView(TextView view)
view
- the text view to be configuredprivate TextView getTextView(View view, int textResource)
view
- the text view or layout containing ittextResource
- the text resource Id in layout
private View getView(int resource, ViewGroup parent)
resource
- the resource Id
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |