onCreateViewHolder

open override fun onCreateViewHolder(context: Context, cards: List<Card>, viewGroup: ViewGroup, viewType: Int): ContentCardViewHolder

Creates an 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.

Return

A new ContentCardViewHolder that holds a View of the given view type.

See also

RecyclerView.Adapter.onCreateViewHolder

Parameters

context

The application context

cards

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.