Package com.xffffff.wellfed.storage
Class StorageIngredientAdapter
- java.lang.Object
-
- androidx.recyclerview.widget.RecyclerView.Adapter<VH>
-
- com.xffffff.wellfed.common.DBAdapter<StorageIngredientAdapter.ViewHolder>
-
- com.xffffff.wellfed.storage.StorageIngredientAdapter
-
- All Implemented Interfaces:
com.google.firebase.firestore.EventListener<com.google.firebase.firestore.QuerySnapshot>
public class StorageIngredientAdapter extends DBAdapter<StorageIngredientAdapter.ViewHolder>
The adapter class for the storage ingredient list.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StorageIngredientAdapter.ViewHolder
The view holder class for the storage ingredient list.-
Nested classes/interfaces inherited from class com.xffffff.wellfed.common.DBAdapter
DBAdapter.OnDataChangedListener
-
-
Constructor Summary
Constructors Constructor Description StorageIngredientAdapter(StorageIngredientDB db)
The constructor for the adapter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onBindViewHolder(StorageIngredientAdapter.ViewHolder holder, int position)
onBindViewHolder is called when the view holder is bound.StorageIngredientAdapter.ViewHolder
onCreateViewHolder(android.view.ViewGroup parent, int viewType)
onCreateViewHolder is called when the view holder is created.void
setOnItemClickListener(OnItemClickListener listener)
-
Methods inherited from class com.xffffff.wellfed.common.DBAdapter
getItemCount, getSnapshot, getSnapshots, onDataChanged, onEvent, setOnDataChangedListener, setQuery, startListening, stopListening
-
Methods inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
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
-
-
-
-
Constructor Detail
-
StorageIngredientAdapter
public StorageIngredientAdapter(StorageIngredientDB db)
The constructor for the adapter.- Parameters:
db
- the storage ingredient DB
-
-
Method Detail
-
onCreateViewHolder
@NonNull public StorageIngredientAdapter.ViewHolder onCreateViewHolder(@NonNull android.view.ViewGroup parent, int viewType)
onCreateViewHolder is called when the view holder is created.- Specified by:
onCreateViewHolder
in classandroidx.recyclerview.widget.RecyclerView.Adapter<StorageIngredientAdapter.ViewHolder>
- Parameters:
parent
- the parent view groupviewType
- the view type- Returns:
- the view holder
-
onBindViewHolder
public void onBindViewHolder(@NonNull StorageIngredientAdapter.ViewHolder holder, int position)
onBindViewHolder is called when the view holder is bound.- Specified by:
onBindViewHolder
in classandroidx.recyclerview.widget.RecyclerView.Adapter<StorageIngredientAdapter.ViewHolder>
- Parameters:
holder
- the view holderposition
- the position of the storage ingredient in the list
-
setOnItemClickListener
public void setOnItemClickListener(OnItemClickListener listener)
-
-