Package com.example.lottery.adapter
Class EntrantHistoryAdapter
java.lang.Object
androidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.EntrantHistoryAdapter.ViewHolder>
com.example.lottery.adapter.EntrantHistoryAdapter
public class EntrantHistoryAdapter
extends androidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.EntrantHistoryAdapter.ViewHolder>
Adapter for displaying the entrant's event registration history.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classData class that pairs anEventwith the entrant's registration status and the organizer's display name.static interfaceListener interface for handling clicks on history items.Nested classes/interfaces inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
androidx.recyclerview.widget.RecyclerView.Adapter.StateRestorationPolicy -
Constructor Summary
ConstructorsConstructorDescriptionEntrantHistoryAdapter(List<EntrantHistoryAdapter.HistoryItem> historyItems, EntrantHistoryAdapter.OnItemClickListener listener, String userId) Creates a new EntrantHistoryAdapter. -
Method Summary
Modifier and TypeMethodDescriptionintvoidonBindViewHolder(com.example.lottery.adapter.EntrantHistoryAdapter.ViewHolder holder, int position) com.example.lottery.adapter.EntrantHistoryAdapter.ViewHolderonCreateViewHolder(android.view.ViewGroup parent, int viewType) 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
-
EntrantHistoryAdapter
public EntrantHistoryAdapter(List<EntrantHistoryAdapter.HistoryItem> historyItems, EntrantHistoryAdapter.OnItemClickListener listener, String userId) Creates a new EntrantHistoryAdapter.- Parameters:
historyItems- list of history items to displaylistener- click listener for item interactionsuserId- the current user's ID
-
-
Method Details
-
onCreateViewHolder
@NonNull public com.example.lottery.adapter.EntrantHistoryAdapter.ViewHolder onCreateViewHolder(@NonNull android.view.ViewGroup parent, int viewType) - Specified by:
onCreateViewHolderin classandroidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.EntrantHistoryAdapter.ViewHolder>
-
onBindViewHolder
public void onBindViewHolder(@NonNull com.example.lottery.adapter.EntrantHistoryAdapter.ViewHolder holder, int position) - Specified by:
onBindViewHolderin classandroidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.EntrantHistoryAdapter.ViewHolder>
-
getItemCount
public int getItemCount()- Specified by:
getItemCountin classandroidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.EntrantHistoryAdapter.ViewHolder>
-