Class AdminBrowseEventsAdapter

java.lang.Object
androidx.recyclerview.widget.RecyclerView.Adapter<AdminBrowseEventsAdapter.EventViewHolder>
com.example.breeze_seas.AdminBrowseEventsAdapter

public class AdminBrowseEventsAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter<AdminBrowseEventsAdapter.EventViewHolder>
Adapter for the RecyclerView in the AdminBrowseEvents screen. Binds a list of Event objects to corresponding UI elements, including event details, dates, and capacities. Also handles user interactions such as clicking on an event to view details or clicking the delete button to remove an event.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Holds references to the UI components for a single event row to avoid repeated findViewById calls.
    static interface 
    Interface definition for a callback to be invoked when an event item is clicked.
    static interface 
    Interface definition for a callback to be invoked when an event's delete button is pressed.

    Nested classes/interfaces inherited from class androidx.recyclerview.widget.RecyclerView.Adapter

    androidx.recyclerview.widget.RecyclerView.Adapter.StateRestorationPolicy
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new AdminBrowseEventsAdapter.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    filter(String query)
    Filters the displayed list to events whose name or description contains the query.
    int
    Returns the total number of items in the data set held by the adapter.
    void
    Called by the RecyclerView to display the data at the specified position.
    onCreateViewHolder(android.view.ViewGroup parent, int viewType)
    Called when the RecyclerView needs a new AdminBrowseEventsAdapter.EventViewHolder of the given type to represent an item.
    void
    setEvents(List<Event> newEvents)
    Replaces the full event list from LiveData, sorts newest first, then reapplies the current search filter.

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait