-
public abstract class GridViewAdapter<T extends Object, VH extends RecyclerView.ViewHolder>GridViewAdapter
-
-
Constructor Summary
Constructors Constructor Description GridViewAdapter()
-
Method Summary
Modifier and Type Method Description abstract VHonCreateViewHolder(ViewGroup parent, Integer viewType)Called when RecyclerView needs a new RecyclerView.ViewHolder of the given type to represent an item. abstract UnitonBindViewHolder(VH holder, Integer position, Integer pagePosition, T item)Called by RecyclerView to display the data at the specified position. -
-
Method Detail
-
onCreateViewHolder
abstract VH onCreateViewHolder(ViewGroup parent, Integer viewType)
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.
-
onBindViewHolder
abstract Unit onBindViewHolder(VH holder, Integer position, Integer pagePosition, T item)
Called by RecyclerView to display the data at the specified position. This method should update the contents of the RecyclerView.ViewHolder.itemView to reflect the item at the given position.
- Parameters:
holder- The ViewHolder which should be updated to represent the contents of the item at the given position in the data set.position- The position of the item within the adapter's data set.pagePosition- The position of the item within the page`s data set.item- The data of current position.
-
-
-
-