public class RendererAdapter<T>
extends android.widget.BaseAdapter
| Constructor and Description |
|---|
RendererAdapter(RendererBuilder<T> rendererBuilder) |
RendererAdapter(RendererBuilder<T> rendererBuilder,
AdapteeCollection<T> collection) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(T element)
Add an element to the AdapteeCollection.
|
void |
addAll(java.util.Collection<? extends T> elements)
Add a Collection of elements to the AdapteeCollection.
|
void |
clear()
Remove all elements inside the AdapteeCollection.
|
protected AdapteeCollection<T> |
getCollection()
Allows the client code to access the AdapteeCollection from subtypes of RendererAdapter.
|
int |
getCount() |
T |
getItem(int position) |
long |
getItemId(int position) |
int |
getItemViewType(int position)
Indicate to the ListView the type of Renderer used to one position using a numeric value.
|
android.view.View |
getView(int position,
android.view.View convertView,
android.view.ViewGroup parent)
Main method of RendererAdapter.
|
int |
getViewTypeCount()
Indicate to the ListView the number of different how many Renderer implementations are in the
RendererBuilder ready to use.
|
void |
remove(java.lang.Object element)
Remove an element from the AdapteeCollection.
|
void |
removeAll(java.util.Collection<?> elements)
Remove a Collection of elements to the AdapteeCollection.
|
void |
setCollection(AdapteeCollection<T> collection) |
protected void |
updateRendererExtraValues(T content,
Renderer<T> renderer,
int position)
Empty implementation created to allow the client code to extend this class without override
getView method.
|
public RendererAdapter(RendererBuilder<T> rendererBuilder)
public RendererAdapter(RendererBuilder<T> rendererBuilder, AdapteeCollection<T> collection)
public int getCount()
public T getItem(int position)
public long getItemId(int position)
public void setCollection(AdapteeCollection<T> collection)
public android.view.View getView(int position,
android.view.View convertView,
android.view.ViewGroup parent)
position - to render.convertView - to use to recycle.parent - used to inflate views.public int getItemViewType(int position)
getItemViewType in interface android.widget.AdaptergetItemViewType in class android.widget.BaseAdapterposition - to analyze.public int getViewTypeCount()
getViewTypeCount in interface android.widget.AdaptergetViewTypeCount in class android.widget.BaseAdapterpublic void add(T element)
element - to add.public void remove(java.lang.Object element)
element - to remove.public void addAll(java.util.Collection<? extends T> elements)
elements - to add.public void removeAll(java.util.Collection<?> elements)
elements - to remove.public void clear()
protected AdapteeCollection<T> getCollection()
protected void updateRendererExtraValues(T content, Renderer<T> renderer, int position)
content - to be rendered.renderer - to be used to paint the content.position - of the content.