Package com.xffffff.wellfed.shoppingcart
Class ShoppingCartIngredientAdapter
- java.lang.Object
-
- androidx.recyclerview.widget.RecyclerView.Adapter<VH>
-
- com.xffffff.wellfed.common.DBAdapter<ShoppingCartIngredientAdapter.ViewHolder>
-
- com.xffffff.wellfed.shoppingcart.ShoppingCartIngredientAdapter
-
- All Implemented Interfaces:
com.google.firebase.firestore.EventListener<com.google.firebase.firestore.QuerySnapshot>
public class ShoppingCartIngredientAdapter extends DBAdapter<ShoppingCartIngredientAdapter.ViewHolder>
This class is the adapter for the ingredients in the shopping cart listIt is used to display the ingredients in the shopping cart list
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ShoppingCartIngredientAdapter.OnCheckedListener
onCheckedListener interface for the ShoppingCartIngredientAdapter.class
ShoppingCartIngredientAdapter.ViewHolder
ViewHolder class for the ShoppingCartIngredientAdapter.-
Nested classes/interfaces inherited from class com.xffffff.wellfed.common.DBAdapter
DBAdapter.OnDataChangedListener
-
-
Constructor Summary
Constructors Constructor Description ShoppingCartIngredientAdapter(ShoppingCartDB db)
Constructor for the adapter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getItemCount()
getItemCount method for the ShoppingCartIngredientAdapter.void
onBindViewHolder(ShoppingCartIngredientAdapter.ViewHolder holder, int position)
onBindViewHolder method for the ShoppingCartIngredientAdapter.ShoppingCartIngredientAdapter.ViewHolder
onCreateViewHolder(android.view.ViewGroup parent, int viewType)
onCreateViewHolder method for the ShoppingCartIngredientAdapter.void
setOnCheckedChangeListener(ShoppingCartIngredientAdapter.OnCheckedListener onCheckedListener)
void
setOnItemClickListener(OnItemClickListener<ShoppingCartIngredient> onItemClickListener)
setOnItemClickListener method for the ShoppingCartIngredientAdapter.-
Methods inherited from class com.xffffff.wellfed.common.DBAdapter
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
-
ShoppingCartIngredientAdapter
public ShoppingCartIngredientAdapter(ShoppingCartDB db)
Constructor for the adapter- Parameters:
db
- the shopping cart db to get the ingredients from
-
-
Method Detail
-
setOnCheckedChangeListener
public void setOnCheckedChangeListener(ShoppingCartIngredientAdapter.OnCheckedListener onCheckedListener)
-
onCreateViewHolder
@NonNull public ShoppingCartIngredientAdapter.ViewHolder onCreateViewHolder(@NonNull android.view.ViewGroup parent, int viewType)
onCreateViewHolder method for the ShoppingCartIngredientAdapter.- Specified by:
onCreateViewHolder
in classandroidx.recyclerview.widget.RecyclerView.Adapter<ShoppingCartIngredientAdapter.ViewHolder>
- Parameters:
parent
- ViewGroup for the adapter.viewType
- int for the adapter.- Returns:
- ViewHolder object for the adapter.
-
onBindViewHolder
public void onBindViewHolder(@NonNull ShoppingCartIngredientAdapter.ViewHolder holder, int position)
onBindViewHolder method for the ShoppingCartIngredientAdapter.- Specified by:
onBindViewHolder
in classandroidx.recyclerview.widget.RecyclerView.Adapter<ShoppingCartIngredientAdapter.ViewHolder>
- Parameters:
holder
- ViewHolder object for the adapter.position
- int for the adapter.
-
getItemCount
public int getItemCount()
getItemCount method for the ShoppingCartIngredientAdapter.- Overrides:
getItemCount
in classDBAdapter<ShoppingCartIngredientAdapter.ViewHolder>
- Returns:
- int for the adapter.
-
setOnItemClickListener
public void setOnItemClickListener(OnItemClickListener<ShoppingCartIngredient> onItemClickListener)
setOnItemClickListener method for the ShoppingCartIngredientAdapter.- Parameters:
onItemClickListener
- OnItemClickListener object for the adapter.
-
-