Package com.example.lottery.adapter
Class ProfileAdapter
java.lang.Object
android.widget.BaseAdapter
android.widget.ArrayAdapter<User>
com.example.lottery.adapter.ProfileAdapter
- All Implemented Interfaces:
android.widget.Adapter,android.widget.Filterable,android.widget.ListAdapter,android.widget.SpinnerAdapter,android.widget.ThemedSpinnerAdapter
Adapter class for displaying user profiles in a list.
This adapter is primarily used by administrators to browse user profiles.
-
Field Summary
Fields inherited from interface android.widget.Adapter
IGNORE_ITEM_VIEW_TYPE, NO_SELECTION -
Constructor Summary
ConstructorsConstructorDescriptionProfileAdapter(android.content.Context context, ArrayList<User> users) Creates an adapter for displaying a list of users. -
Method Summary
Modifier and TypeMethodDescriptionandroid.view.ViewgetView(int position, android.view.View convertView, android.view.ViewGroup parent) Returns a view for the user at the given 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
-
ProfileAdapter
Creates an adapter for displaying a list of users.- Parameters:
context- the context used to inflate viewsusers- the users to display
-
-
Method Details
-
getView
@NonNull public android.view.View getView(int position, @Nullable android.view.View convertView, @NonNull android.view.ViewGroup parent) Returns a view for the user at the given position.- Specified by:
getViewin interfaceandroid.widget.Adapter- Overrides:
getViewin classandroid.widget.ArrayAdapter<User>- Parameters:
position- the position of the user in the listconvertView- the recycled view to reuse if availableparent- the parent view group- Returns:
- the view displaying the user information
-