public class InboxListAdapter extends android.widget.ArrayAdapter<InboxCampaign>
ArrayAdapter
class that loads and displays inbox campaigns.
Integration:
Adapter
for a
ListView
.
getData(Listener)
to load inbox campaigns into the Adapter
.
The InboxListAdapter.Listener
interface can be used to know when loading is complete.AdapterView.setOnItemClickListener(AdapterView.OnItemClickListener)
and use InboxDetailFragment
to display the full inbox creative.getView(int, View, ViewGroup)
to provide a custom inflated ViewsetDownloadsThumbnails(boolean)
Modifier and Type | Class and Description |
---|---|
static interface |
InboxListAdapter.Listener
An interface use for receiving inbox campaigns loading callbacks.
|
Constructor and Description |
---|
InboxListAdapter(android.content.Context context) |
InboxListAdapter(android.content.Context context,
android.widget.ListView listView)
Constructs a new InboxListAdapter, and sets up a swipe to delete control.
|
Modifier and Type | Method and Description |
---|---|
void |
getData(InboxListAdapter.Listener listener)
Load inbox campaigns into the
Adapter . |
android.view.View |
getView(int position,
android.view.View convertView,
android.view.ViewGroup parent) |
void |
setDownloadsThumbnails(boolean downloadsThumbnails)
Set whether thumbnail images are automatically downloaded and loaded into the
InboxListItem . |
add, addAll, addAll, clear, createFromResource, getAutofillOptions, getContext, getCount, getDropDownView, getDropDownViewTheme, getFilter, getItem, getItemId, getPosition, insert, notifyDataSetChanged, remove, setDropDownViewResource, setDropDownViewTheme, setNotifyOnChange, sort
areAllItemsEnabled, getItemViewType, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetInvalidated, registerDataSetObserver, setAutofillOptions, unregisterDataSetObserver
public InboxListAdapter(@NonNull android.content.Context context)
public InboxListAdapter(@NonNull android.content.Context context, @NonNull android.widget.ListView listView)
context
- the activity's context.listView
- The list view associated with this adapter whose items should be dismissable.@NonNull public android.view.View getView(int position, @Nullable android.view.View convertView, android.view.ViewGroup parent)
getView
in interface android.widget.Adapter
getView
in class android.widget.ArrayAdapter<InboxCampaign>
public void getData(@Nullable InboxListAdapter.Listener listener)
Adapter
.listener
- Callback for when loading is complete.InboxListAdapter.Listener
public void setDownloadsThumbnails(boolean downloadsThumbnails)
InboxListItem
.
Defaults to true. Set this value to false to manually manage thumbnail downloading and
caching (such as through a 3rd party networking library).downloadsThumbnails
- Flag to indicate whether thumbnails should be automatically downloaded