ItemType - The type of the items, which should be visualized by the adapterParamType - The type of the optional parameters, which may be passed when inflating a viewpublic abstract static class AbstractViewRecycler.Adapter<ItemType,ParamType>
extends java.lang.Object
| Constructor and Description |
|---|
Adapter() |
| Modifier and Type | Method and Description |
|---|---|
int |
getViewType(ItemType item)
Returns the view type, which corresponds to a specific item.
|
int |
getViewTypeCount()
Returns the number of view types, which are used by the adapter.
|
abstract android.view.View |
onInflateView(android.view.LayoutInflater inflater,
android.view.ViewGroup parent,
ItemType item,
int viewType,
ParamType... params)
The method, which is invoked in order to inflate the view, which should be used to
visualize a specific item.
|
void |
onRemoveView(android.view.View view,
ItemType item)
The method, which is invoked when a previously inflated view is about to be removed from
its parent.
|
abstract void |
onShowView(android.content.Context context,
android.view.View view,
ItemType item,
boolean inflated,
ParamType... params)
The method, which is invoked in order to adapt the appearance of the view, which is used
to visualize a specific item.
|
public abstract android.view.View onInflateView(android.view.LayoutInflater inflater,
android.view.ViewGroup parent,
ItemType item,
int viewType,
ParamType... params)
onShowItem is
responsible.inflater - The layout inflater, which should be used to inflate the view, as an instance of
the class LayoutInflater. The layout inflater may not be nullparent - The parent, the inflated view will be added to, as an instance of the class
ViewGroup or null, if the view will not be added to a parentitem - The item, which should be visualized by the inflated view, as an instance of the
generic type ItemType. The item may not be nullviewType - The view type, which corresponds to the item, which should be visualized, as an
Integer valueparams - An array, which may contain optional parameters, as an array of the generic type
ParamType or an empty array, if no optional parameters are availableView. The
view may not be nullpublic abstract void onShowView(android.content.Context context,
android.view.View view,
ItemType item,
boolean inflated,
ParamType... params)
context - The context, which is used by the adapter, as an instance of the class Context. The context may not be nullview - The view, whose appearance should be adapted, as an instance of the class View. The view may not be nullitem - The item, which should be visualized, as an instance of the generic type
ItemType. The item may not be nullinflated - True, if the view has been inflated, false, if it has been reusedparams - An array, which may contain optional parameters, as an array of the generic type
ParamType or an empty array, if no optional parameters are availablepublic void onRemoveView(android.view.View view,
ItemType item)
view - The view, which is about to be removed from its parent, as an instance of the
class View. The view may not be nullitem - The item, which is visualized by the view, which is about to be removed, as an
instance of the generic type ItemType. The item may not be nullpublic int getViewType(ItemType item)
onInflateView-method, a distinct view type must be
returned.item - The item, whose view type should be returned, as an instance of the generic type
ItemType. The item may not be nullInteger valuepublic int getViewTypeCount()
Integer
value. The number of view types must correspond to the number of distinct values, which
are returned by the getViewType-method