Class OrganizerMyEventsArrayAdapter

java.lang.Object
android.widget.BaseAdapter
android.widget.ArrayAdapter<Event>
com.example.oblong.organizer.OrganizerMyEventsArrayAdapter
All Implemented Interfaces:
android.widget.Adapter, android.widget.Filterable, android.widget.ListAdapter, android.widget.SpinnerAdapter, android.widget.ThemedSpinnerAdapter

public class OrganizerMyEventsArrayAdapter extends android.widget.ArrayAdapter<Event>
Custom ArrayAdapter for displaying a list of events in the organizer's "My Events" section.

This adapter binds event data to a custom list item layout and provides click functionality for viewing event details and accepting events. It uses the Event class for event data.

Each list item displays the event poster, name, and draw date, along with buttons for viewing or interacting with the event.

  • Field Summary

    Fields inherited from interface android.widget.Adapter

    IGNORE_ITEM_VIEW_TYPE, NO_SELECTION
  • Constructor Summary

    Constructors
    Constructor
    Description
    OrganizerMyEventsArrayAdapter(android.content.Context context, ArrayList<Event> events)
    Constructor for the custom adapter.
  • Method Summary

    Modifier and Type
    Method
    Description
    android.view.View
    getView(int position, android.view.View convertView, android.view.ViewGroup parent)
    Provides a view for an adapter's item at a specific position.

    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

    • OrganizerMyEventsArrayAdapter

      public OrganizerMyEventsArrayAdapter(android.content.Context context, ArrayList<Event> events)
      Constructor for the custom adapter.
      Parameters:
      context - The context in which the adapter is being used.
      events - The list of Event objects to display in the adapter.
  • Method Details

    • getView

      @NonNull public android.view.View getView(int position, @Nullable android.view.View convertView, @NonNull android.view.ViewGroup parent)
      Provides a view for an adapter's item at a specific position.

      This method inflates a custom layout for each event item in the list and sets the event data, such as the poster, name, and draw date. It also defines click listeners for buttons to view and interact with the event.

      Specified by:
      getView in interface android.widget.Adapter
      Overrides:
      getView in class android.widget.ArrayAdapter<Event>
      Parameters:
      position - The position of the item within the adapter's data set.
      convertView - The old view to reuse, if possible.
      parent - The parent that this view will eventually be attached to.
      Returns:
      A View corresponding to the data at the specified position.