Package com.example.lottery.adapter
Class OrganizerNotificationEventAdapter
java.lang.Object
androidx.recyclerview.widget.RecyclerView.Adapter<OrganizerNotificationEventAdapter.ViewHolder>
com.example.lottery.adapter.OrganizerNotificationEventAdapter
public class OrganizerNotificationEventAdapter
extends androidx.recyclerview.widget.RecyclerView.Adapter<OrganizerNotificationEventAdapter.ViewHolder>
Adapter for displaying events in the Organizer Notifications screen.
Each item allows the organizer to send notifications to different groups of entrants.
Key Responsibilities:
- Binds event data to the list items in the notification screen.
- Delegates button clicks to a listener to handle notification composition.
- Provides navigation to the entrants management list.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceListener interface for handling clicks on notification group buttons.static classViewHolder class for caching UI component references in each list item.Nested classes/interfaces inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
androidx.recyclerview.widget.RecyclerView.Adapter.StateRestorationPolicy -
Constructor Summary
ConstructorsConstructorDescriptionOrganizerNotificationEventAdapter(List<Event> eventList, OrganizerNotificationEventAdapter.OnNotificationGroupClickListener listener) Constructs a new OrganizerNotificationEventAdapter. -
Method Summary
Modifier and TypeMethodDescriptionintvoidonBindViewHolder(OrganizerNotificationEventAdapter.ViewHolder holder, int position) onCreateViewHolder(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
-
OrganizerNotificationEventAdapter
public OrganizerNotificationEventAdapter(List<Event> eventList, OrganizerNotificationEventAdapter.OnNotificationGroupClickListener listener) Constructs a new OrganizerNotificationEventAdapter.- Parameters:
eventList- The list of events to display.listener- The listener to handle group click events.
-
-
Method Details
-
onCreateViewHolder
@NonNull public OrganizerNotificationEventAdapter.ViewHolder onCreateViewHolder(@NonNull android.view.ViewGroup parent, int viewType) - Specified by:
onCreateViewHolderin classandroidx.recyclerview.widget.RecyclerView.Adapter<OrganizerNotificationEventAdapter.ViewHolder>
-
onBindViewHolder
public void onBindViewHolder(@NonNull OrganizerNotificationEventAdapter.ViewHolder holder, int position) - Specified by:
onBindViewHolderin classandroidx.recyclerview.widget.RecyclerView.Adapter<OrganizerNotificationEventAdapter.ViewHolder>
-
getItemCount
public int getItemCount()- Specified by:
getItemCountin classandroidx.recyclerview.widget.RecyclerView.Adapter<OrganizerNotificationEventAdapter.ViewHolder>
-