commons/ui / com.vmadalin.commons.ui.base / BaseListAdapter / onCreateViewHolder

onCreateViewHolder

abstract fun onCreateViewHolder(parent: ViewGroup, inflater: LayoutInflater, viewType: Int): ViewHolder

Called when RecyclerView needs a new RecyclerView.ViewHolder of the given type to represent an item.

Parameters

parent - The ViewGroup into which the new View will be added after it is bound to an adapter position.

inflater - Instantiates a layout XML file into its corresponding View objects.

viewType - The view type of the new View.

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

See Also

ListAdapter.onCreateViewHolder

open fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder

Called when RecyclerView needs a new RecyclerView.ViewHolder of the given type to represent an item.

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.

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

See Also

ListAdapter.onCreateViewHolder