public class StormListAdapter
extends android.widget.BaseAdapter
Model classes which have a defined Holder counter-class.
Usage
Problems
Problems can arise with this method of rendering content, specifically with render efficiency where
the views are not being recycled because there is only 1 of its view type in the list. This is the
equivalent of having all of the views inflated into a ScrollView. The smoothness
of the scrolling (depending on how much content there is) diminishes with the amount of unique content
that the list is rendering.| Constructor and Description |
|---|
StormListAdapter(android.content.Context context) |
StormListAdapter(android.content.Context context,
java.util.Collection<? extends Model> items) |
| Modifier and Type | Method and Description |
|---|---|
void |
addItem(Model item)
Adds an item to the list, only if a holder class is found as returned by
ViewFactory.getHolderForView(String) |
int |
getCount() |
Model |
getItem(int position) |
long |
getItemId(int position) |
int |
getItemViewType(int position) |
android.view.View |
getView(int position,
android.view.View convertView,
android.view.ViewGroup parent) |
int |
getViewTypeCount() |
boolean |
isEnabled(int position) |
void |
setItems(java.util.Collection<? extends Model> items)
Sets the items in the collection.
|
public StormListAdapter(android.content.Context context)
public StormListAdapter(android.content.Context context,
java.util.Collection<? extends Model> items)
public void setItems(java.util.Collection<? extends Model> items)
Holderitems - The new items to set. Can be null to clear the list.public void addItem(Model item)
ViewFactory.getHolderForView(String)item - The model to add to the listpublic int getCount()
public Model getItem(int position)
public long getItemId(int position)
public boolean isEnabled(int position)
isEnabled in interface android.widget.ListAdapterisEnabled in class android.widget.BaseAdapterpublic int getViewTypeCount()
getViewTypeCount in interface android.widget.AdaptergetViewTypeCount in class android.widget.BaseAdapterpublic int getItemViewType(int position)
getItemViewType in interface android.widget.AdaptergetItemViewType in class android.widget.BaseAdapterpublic android.view.View getView(int position,
android.view.View convertView,
android.view.ViewGroup parent)