Package com.example.lottery.adapter
Class NotificationLogAdapter
java.lang.Object
androidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.NotificationLogAdapter.LogViewHolder>
com.example.lottery.adapter.NotificationLogAdapter
public class NotificationLogAdapter
extends androidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.NotificationLogAdapter.LogViewHolder>
Displays organizer notification logs in the admin log browser.
-
Nested Class Summary
Nested classes/interfaces inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
androidx.recyclerview.widget.RecyclerView.Adapter.StateRestorationPolicy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the total number of log items.voidonBindViewHolder(com.example.lottery.adapter.NotificationLogAdapter.LogViewHolder holder, int position) Binds log data to the given ViewHolder.com.example.lottery.adapter.NotificationLogAdapter.LogViewHolderonCreateViewHolder(android.view.ViewGroup parent, int viewType) Creates a new ViewHolder for a log item.Methods inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
bindViewHolder, createViewHolder, findRelativeAdapterPositionIn, getItemId, getItemViewType, getStateRestorationPolicy, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onAttachedToRecyclerView, onBindViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, setHasStableIds, setStateRestorationPolicy, unregisterAdapterDataObserver
-
Constructor Details
-
NotificationLogAdapter
- Parameters:
logList- raw Firestore document data for each notification log
-
-
Method Details
-
onCreateViewHolder
@NonNull public com.example.lottery.adapter.NotificationLogAdapter.LogViewHolder onCreateViewHolder(@NonNull android.view.ViewGroup parent, int viewType) Creates a new ViewHolder for a log item.- Specified by:
onCreateViewHolderin classandroidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.NotificationLogAdapter.LogViewHolder>- Parameters:
parent- the parent view groupviewType- the view type- Returns:
- a new
NotificationLogAdapter.LogViewHolder
-
onBindViewHolder
public void onBindViewHolder(@NonNull com.example.lottery.adapter.NotificationLogAdapter.LogViewHolder holder, int position) Binds log data to the given ViewHolder.- Specified by:
onBindViewHolderin classandroidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.NotificationLogAdapter.LogViewHolder>- Parameters:
holder- the ViewHolder to bindposition- the position in the list
-
getItemCount
public int getItemCount()Returns the total number of log items.- Specified by:
getItemCountin classandroidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.NotificationLogAdapter.LogViewHolder>- Returns:
- size of the log list
-