Class EventAdapter

java.lang.Object
android.widget.BaseAdapter
android.widget.ArrayAdapter<Event>
com.example.skeddly.ui.adapter.EventAdapter
All Implemented Interfaces:
android.widget.Adapter, android.widget.Filterable, android.widget.ListAdapter, android.widget.SpinnerAdapter, android.widget.ThemedSpinnerAdapter

public class EventAdapter extends android.widget.ArrayAdapter<Event>
Adapter for the event list view
  • Field Summary

    Fields inherited from interface android.widget.Adapter

    IGNORE_ITEM_VIEW_TYPE, NO_SELECTION
  • Constructor Summary

    Constructors
    Constructor
    Description
    EventAdapter(android.content.Context context, ArrayList<Event> events, User user, RetrieveLocation locationGetter, int viewInfoActionId, int editActionId)
    Constructor for the EventAdapter
  • Method Summary

    Modifier and Type
    Method
    Description
    android.view.View
    getView(int position, android.view.View convertView, android.view.ViewGroup parent)
     
    void
    updateJoinButtonState(android.widget.Button buttonJoin, Event event, String userId, DatabaseHandler dbHandler)
    Updates the state of the join button based on the user's ticket status.

    Methods inherited from class android.widget.ArrayAdapter

    add, addAll, addAll, clear, createFromResource, getAutofillOptions, getContext, getCount, getDropDownView, getDropDownViewTheme, getFilter, getItem, getItemId, getPosition, insert, notifyDataSetChanged, remove, setDropDownViewResource, setDropDownViewTheme, setNotifyOnChange, sort

    Methods inherited from class android.widget.BaseAdapter

    areAllItemsEnabled, getItemViewType, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetInvalidated, registerDataSetObserver, setAutofillOptions, unregisterDataSetObserver

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface android.widget.Adapter

    getItemViewType, getViewTypeCount, hasStableIds, isEmpty, registerDataSetObserver, unregisterDataSetObserver
  • Constructor Details

    • EventAdapter

      public EventAdapter(android.content.Context context, ArrayList<Event> events, User user, RetrieveLocation locationGetter, int viewInfoActionId, int editActionId)
      Constructor for the EventAdapter
      Parameters:
      context - The context of the app
      events - The events to display
      user - The current user
      locationGetter - A callback for retrieving the user's location
      viewInfoActionId - The navigation action ID for viewing event info
      editActionId - The navigation action ID for editing an event
  • Method Details

    • getView

      @NonNull public android.view.View getView(int position, @Nullable android.view.View convertView, @NonNull android.view.ViewGroup parent)
      Specified by:
      getView in interface android.widget.Adapter
      Overrides:
      getView in class android.widget.ArrayAdapter<Event>
    • updateJoinButtonState

      public void updateJoinButtonState(android.widget.Button buttonJoin, Event event, String userId, DatabaseHandler dbHandler)
      Updates the state of the join button based on the user's ticket status.
      Parameters:
      buttonJoin - The button to update
      event - The event to check
      userId - The user ID
      dbHandler - The database handler