Package com.example.oblong.organizer
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
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
ConstructorsConstructorDescriptionOrganizerMyEventsArrayAdapter(android.content.Context context, ArrayList<Event> events) Constructor for the custom adapter. -
Method Summary
Modifier and TypeMethodDescriptionandroid.view.ViewgetView(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, sortMethods inherited from class android.widget.BaseAdapter
areAllItemsEnabled, getItemViewType, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetInvalidated, registerDataSetObserver, setAutofillOptions, unregisterDataSetObserverMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface android.widget.Adapter
getItemViewType, getViewTypeCount, hasStableIds, isEmpty, registerDataSetObserver, unregisterDataSetObserver
-
Constructor Details
-
OrganizerMyEventsArrayAdapter
Constructor for the custom adapter.- Parameters:
context- The context in which the adapter is being used.events- The list ofEventobjects 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:
getViewin interfaceandroid.widget.Adapter- Overrides:
getViewin classandroid.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
Viewcorresponding to the data at the specified position.
-