|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectBaseAdapter
uk.co.ribot.easyadapter.EasyAdapter<T>
public class EasyAdapter<T>
Extension of BaseAdapter. Don't worry about implementing your own Adapter, the EasyAdapter will do the tedious work for you.
You just have to implement an ItemViewHolder
and pass it into the constructor of this class.
Constructor Summary | |
---|---|
EasyAdapter(Context context,
Class itemViewHolderClass)
Constructs and EasyAdapter with a Context and an ItemViewHolder class. |
|
EasyAdapter(Context context,
Class itemViewHolderClass,
List<T> listItems)
Constructs and EasyAdapter with a Context, an ItemViewHolder class, and list of items. |
Method Summary | |
---|---|
void |
addItem(T item)
Adds a single item to the Adapter |
void |
addItems(List<T> listItems)
Appends a list of items to the ones already in the Adapter |
int |
getCount()
|
T |
getItem(int position)
|
long |
getItemId(int position)
|
View |
getView(int position,
View convertView,
ViewGroup parent)
|
void |
setItems(List<T> listItems)
Sets a new list of items into the Adapter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EasyAdapter(Context context, Class itemViewHolderClass, List<T> listItems)
ItemViewHolder
class, and list of items.
context
- a valid ContextitemViewHolderClass
- your ItemViewHolder
implementation classlistItems
- the list of items to load in the Adapterpublic EasyAdapter(Context context, Class itemViewHolderClass)
ItemViewHolder
class.
context
- a valid ContextitemViewHolderClass
- your ItemViewHolder
implementation classMethod Detail |
---|
public void setItems(List<T> listItems)
listItems
- new list of itemspublic void addItem(T item)
item
- item to addpublic void addItems(List<T> listItems)
listItems
- list of items to appendpublic int getCount()
public long getItemId(int position)
public T getItem(int position)
public View getView(int position, View convertView, ViewGroup parent)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |