Package com.example.lottery.adapter
Class EntrantEventAdapter
java.lang.Object
androidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.EntrantEventAdapter.EntrantEventViewHolder>
com.example.lottery.adapter.EntrantEventAdapter
public class EntrantEventAdapter
extends androidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.EntrantEventAdapter.EntrantEventViewHolder>
RecyclerView adapter used to display events to entrants on the
EntrantMainActivity screen.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceListener interface used to notify when an event item is clicked.Nested classes/interfaces inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
androidx.recyclerview.widget.RecyclerView.Adapter.StateRestorationPolicy -
Constructor Summary
ConstructorsConstructorDescriptionEntrantEventAdapter(List<Event> eventList, EntrantEventAdapter.OnEventClickListener listener, String userId) Constructs an EntrantEventAdapter. -
Method Summary
Modifier and TypeMethodDescriptionintvoidonBindViewHolder(com.example.lottery.adapter.EntrantEventAdapter.EntrantEventViewHolder holder, int position) com.example.lottery.adapter.EntrantEventAdapter.EntrantEventViewHolderonCreateViewHolder(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
-
EntrantEventAdapter
public EntrantEventAdapter(List<Event> eventList, EntrantEventAdapter.OnEventClickListener listener, String userId) Constructs an EntrantEventAdapter.- Parameters:
eventList- list of events to displaylistener- listener that handles event selectionuserId- current user ID (unused, kept for API compatibility)
-
-
Method Details
-
onCreateViewHolder
@NonNull public com.example.lottery.adapter.EntrantEventAdapter.EntrantEventViewHolder onCreateViewHolder(@NonNull android.view.ViewGroup parent, int viewType) - Specified by:
onCreateViewHolderin classandroidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.EntrantEventAdapter.EntrantEventViewHolder>
-
onBindViewHolder
public void onBindViewHolder(@NonNull com.example.lottery.adapter.EntrantEventAdapter.EntrantEventViewHolder holder, int position) - Specified by:
onBindViewHolderin classandroidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.EntrantEventAdapter.EntrantEventViewHolder>
-
getItemCount
public int getItemCount()- Specified by:
getItemCountin classandroidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.EntrantEventAdapter.EntrantEventViewHolder>
-