public class CookbookRecyclerAdapter extends RecyclerView.Adapter<com.semartinez.projects.choppit.view.CookbookRecyclerAdapter.CookbookViewHolder>
CookbookFragment
Constructor and Description |
---|
CookbookRecyclerAdapter(Context context,
List<Recipe> recipes,
CookbookFragment cookbookFragment)
Handles Data Binding input retrieved from the database and displays the list of
Recipe s |
Modifier and Type | Method and Description |
---|---|
int |
getItemCount() |
void |
onBindViewHolder(com.semartinez.projects.choppit.view.CookbookRecyclerAdapter.CookbookViewHolder holder,
int position)
Attaches each Recipe to a ViewHolder.
|
com.semartinez.projects.choppit.view.CookbookRecyclerAdapter.CookbookViewHolder |
onCreateViewHolder(ViewGroup parent,
int viewType) |
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 CookbookRecyclerAdapter(Context context, List<Recipe> recipes, CookbookFragment cookbookFragment)
Recipe
s@NonNull public com.semartinez.projects.choppit.view.CookbookRecyclerAdapter.CookbookViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType)
onCreateViewHolder
in class RecyclerView.Adapter<com.semartinez.projects.choppit.view.CookbookRecyclerAdapter.CookbookViewHolder>
parent
- where the new ViewHolder will be added.viewType
- is not used in this override.public void onBindViewHolder(@NonNull com.semartinez.projects.choppit.view.CookbookRecyclerAdapter.CookbookViewHolder holder, int position)
onBindViewHolder
in class RecyclerView.Adapter<com.semartinez.projects.choppit.view.CookbookRecyclerAdapter.CookbookViewHolder>
holder
- generated by onCreateViewHolder(ViewGroup, int)
.position
- the index of the Recipe being added to the ViewHolder.public int getItemCount()
getItemCount
in class RecyclerView.Adapter<com.semartinez.projects.choppit.view.CookbookRecyclerAdapter.CookbookViewHolder>