public class PathAdapter extends RecyclerView.Adapter<PathAdapter.Holder>
Modifier and Type | Class and Description |
---|---|
class |
PathAdapter.Holder
Represents an entry in a
PathAdapter . |
Constructor and Description |
---|
PathAdapter(List<String> pathSegments,
com.moppyandroid.main.PathAdapter.ClickListener clickListener)
|
Modifier and Type | Method and Description |
---|---|
int |
getItemCount()
Gets the size of the data set.
|
void |
onBindViewHolder(PathAdapter.Holder holder,
int position)
Method triggered when a
PathAdapter.Holder is bound to the RecyclerView . |
PathAdapter.Holder |
onCreateViewHolder(ViewGroup parent,
int viewType)
Method triggered when a
RecyclerView.ViewHolder is created. |
bindViewHolder, createViewHolder, getItemId, getItemViewType, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onAttachedToRecyclerView, onBindViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, setHasStableIds, unregisterAdapterDataObserver
public PathAdapter.Holder onCreateViewHolder(ViewGroup parent, int viewType)
RecyclerView.ViewHolder
is created.onCreateViewHolder
in class RecyclerView.Adapter<PathAdapter.Holder>
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.RecyclerView.Adapter.getItemViewType(int)
,
#onBindViewHolder(ViewHolder, int)
public void onBindViewHolder(PathAdapter.Holder holder, int position)
PathAdapter.Holder
is bound to the RecyclerView
.onBindViewHolder
in class RecyclerView.Adapter<PathAdapter.Holder>
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.public int getItemCount()
getItemCount
in class RecyclerView.Adapter<PathAdapter.Holder>