public class DefaultContentCardsViewBindingHandler extends java.lang.Object implements IContentCardsViewBindingHandler
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<DefaultContentCardsViewBindingHandler> |
CREATOR |
Constructor and Description |
---|
DefaultContentCardsViewBindingHandler() |
Modifier and Type | Method and Description |
---|---|
int |
describeContents() |
int |
getItemViewType(android.content.Context context,
java.util.List<Card> cards,
int adapterPosition)
Returns the view type of the item at the given position for the purposes of view recycling purposes.
|
void |
onBindViewHolder(android.content.Context context,
java.util.List<Card> cards,
ContentCardViewHolder viewHolder,
int adapterPosition)
Called to display the data at the specified adapter position.
|
ContentCardViewHolder |
onCreateViewHolder(android.content.Context context,
java.util.List<Card> cards,
android.view.ViewGroup viewGroup,
int viewType)
Creates an
ContentCardViewHolder of the given type to represent an item in the ContentCards. |
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public static final android.os.Parcelable.Creator<DefaultContentCardsViewBindingHandler> CREATOR
public DefaultContentCardsViewBindingHandler()
public ContentCardViewHolder onCreateViewHolder(android.content.Context context, java.util.List<Card> cards, android.view.ViewGroup viewGroup, int viewType)
IContentCardsViewBindingHandler
ContentCardViewHolder
of the given type to represent an item in the ContentCards. You can create
a new View manually or inflate it from an XML layout file.
The new ContentCardViewHolder
will be used to display adapter items
using IContentCardsViewBindingHandler.onBindViewHolder(Context, List, ContentCardViewHolder, int)
.onCreateViewHolder
in interface IContentCardsViewBindingHandler
context
- The application contextcards
- The collection of card items in the adapter. Should not be modified.viewGroup
- The ViewGroup
into which the new View will be added after it is bound to an adapter position.viewType
- The view type of the new View.ContentCardViewHolder
that holds a View of the given view type.RecyclerView.Adapter#onCreateViewHolder(ViewGroup, int)
public void onBindViewHolder(android.content.Context context, java.util.List<Card> cards, ContentCardViewHolder viewHolder, int adapterPosition)
IContentCardsViewBindingHandler
ContentCardViewHolder#itemView
to reflect the item at the given adapter position.onBindViewHolder
in interface IContentCardsViewBindingHandler
context
- The application context.cards
- The collection of card items in the adapter. Should not be modified.viewHolder
- The ContentCardViewHolder
which should be updated to represent the contents
of the item at the given adapter position.adapterPosition
- The position of the item within the adapter's card items.RecyclerView.Adapter#onBindViewHolder(RecyclerView.ViewHolder, int)
public int getItemViewType(android.content.Context context, java.util.List<Card> cards, int adapterPosition)
IContentCardsViewBindingHandler
getItemViewType
in interface IContentCardsViewBindingHandler
context
- The application context.cards
- The collection of card items in the adapter. Should not be modified.adapterPosition
- The position of the item within the adapter's card items.public int describeContents()
describeContents
in interface android.os.Parcelable
public void writeToParcel(android.os.Parcel dest, int flags)
writeToParcel
in interface android.os.Parcelable