Class EntrantAllEventsArrayAdapter

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

public class EntrantAllEventsArrayAdapter extends android.widget.ArrayAdapter<Event>
Custom ArrayAdapter for displaying a list of events in the "All Events" section of the entrant's interface.

This adapter is responsible for inflating the list item view for each event and setting its corresponding data such as event name and draw date. It also provides an onClickListener for the "View" button to handle user interactions.

  • Field Summary

    Fields inherited from interface android.widget.Adapter

    IGNORE_ITEM_VIEW_TYPE, NO_SELECTION
  • Constructor Summary

    Constructors
    Constructor
    Description
    EntrantAllEventsArrayAdapter(android.content.Context context, ArrayList<Event> events)
    Constructs a new EntrantAllEventsArrayAdapter.
  • 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 view (ListView) for each event item in the list.

    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

    • EntrantAllEventsArrayAdapter

      public EntrantAllEventsArrayAdapter(android.content.Context context, ArrayList<Event> events)
      Constructs a new EntrantAllEventsArrayAdapter.
      Parameters:
      context - The context of the current state of the application.
      events - The list of events to be displayed in the ListView.
  • 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 view (ListView) for each event item in the list.

      This method inflates the layout for each event list item and sets the event data such as the event name and draw date. It also sets a click listener on the "View" button for each 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 view that this view will eventually be attached to.
      Returns:
      The constructed view for the specified position in the list.