onCreateViewHolder

open fun onCreateViewHolder(@NonNull parent: ViewGroup, viewType: Int): BaseViewHolder<BaseMessage>

Called when RecyclerView needs a new BaseViewHolder<BaseMessage> of the given type to represent an item.

Return

A new BaseViewHolder<BaseMessage> that holds a View of the given view type.

See also

Parameters

parent

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.