public interface

ItemViewHolderCreator

com.shinobicontrols.grids.core.ItemViewHolderCreator
Known Indirect Subclasses

Class Overview

An ItemViewHolderCreator maps an itemViewType, which is just a unique int identifier, to a method of creating a corresponding android.support.v7.widget.RecyclerView.ViewHolder. The library pre-registers a number of built-in ItemViewHolderCreators for you to use. In addition, custom ItemViewHolderCreators can be registered with a ShinobiGridView to allow Columns to make use of them. R.id lists the corresponding itemViewTypes of the built-in ItemViewHolderCreators available.

The itemViewType should be unique for each ItemViewHolderCreator. As such it is recommended that XML id resources are used to define these ids.

Summary

Public Methods
abstract RecyclerView.ViewHolder createItemViewHolder(ViewGroup parent)

Creates a ViewHolder that is applicable for the itemViewType this ItemViewHolderCreator represents.

abstract int getItemViewType()

Returns the itemViewType that this ItemViewHolderCreator creates ViewHolders for.

Public Methods

public abstract RecyclerView.ViewHolder createItemViewHolder (ViewGroup parent)

Creates a ViewHolder that is applicable for the itemViewType this ItemViewHolderCreator represents.

Parameters
parent the parent ViewGroup of the item view; this provides access to the current android.content.Context
Returns
  • a ViewHolder that is applicable for the itemViewType this ItemViewHolderCreator represents

public abstract int getItemViewType ()

Returns the itemViewType that this ItemViewHolderCreator creates ViewHolders for.

Returns
  • the itemViewType that this ItemViewHolderCreator creates ViewHolders for