public class AppboyListAdapter extends android.widget.ArrayAdapter<Card>
add(Card)
,
ArrayAdapter.clear()
clear(),
replaceFeed(java.util.List)
Constructor and Description |
---|
AppboyListAdapter(android.content.Context context,
int layoutResourceId,
java.util.List<Card> cards) |
Modifier and Type | Method and Description |
---|---|
void |
add(Card card) |
void |
batchSetCardsToRead(int startIndex,
int endIndex)
Helper method to batch set cards to visually read after either an up or down scroll of the feed.
|
int |
getItemViewType(int position) |
android.view.View |
getView(int position,
android.view.View convertView,
android.view.ViewGroup parent)
Always try to use a convert view if possible, otherwise create one from scratch.
|
int |
getViewTypeCount()
Be sure to keep view count in sync with the number of card types in the stream.
|
void |
replaceFeed(java.util.List<Card> cards) |
void |
resetCardImpressionTracker()
Resets the list of viewed cards.
|
addAll, addAll, clear, createFromResource, getAutofillOptions, getContext, getCount, getDropDownView, getDropDownViewTheme, getFilter, getItem, getItemId, getPosition, insert, notifyDataSetChanged, remove, setDropDownViewResource, setDropDownViewTheme, setNotifyOnChange, sort
areAllItemsEnabled, hasStableIds, isEmpty, isEnabled, notifyDataSetInvalidated, registerDataSetObserver, setAutofillOptions, unregisterDataSetObserver
public AppboyListAdapter(android.content.Context context, int layoutResourceId, java.util.List<Card> cards)
public int getViewTypeCount()
getViewTypeCount
in interface android.widget.Adapter
getViewTypeCount
in class android.widget.BaseAdapter
public int getItemViewType(int position)
getItemViewType
in interface android.widget.Adapter
getItemViewType
in class android.widget.BaseAdapter
public android.view.View getView(int position, android.view.View convertView, android.view.ViewGroup parent)
getView
in interface android.widget.Adapter
getView
in class android.widget.ArrayAdapter<Card>
public void replaceFeed(java.util.List<Card> cards)
public void resetCardImpressionTracker()
public void batchSetCardsToRead(int startIndex, int endIndex)
startIndex
- Where to start setting cards to viewed. The card at this index will
be set to viewed. Must be less than endIndexendIndex
- Where to end setting cards to viewed. The card at this index will be set to viewed.