Class CommentAdapter
- java.lang.Object
-
- android.widget.BaseAdapter
-
- android.widget.ArrayAdapter<Comment>
-
- com.cmput301w23t09.qrhunter.comment.CommentAdapter
-
- All Implemented Interfaces:
android.widget.Adapter,android.widget.Filterable,android.widget.ListAdapter,android.widget.SpinnerAdapter,android.widget.ThemedSpinnerAdapter
public class CommentAdapter extends android.widget.ArrayAdapter<Comment>
The CommentAdapter is responsible for managing and creating view for each comment object
-
-
Constructor Summary
Constructors Constructor Description CommentAdapter(android.content.Context context, java.util.List<Comment> playerComments)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description android.view.ViewgetView(int position, android.view.View convertView, android.view.ViewGroup parent)Returns view for each row in the listview-
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
-
-
-
-
Constructor Detail
-
CommentAdapter
public CommentAdapter(android.content.Context context, java.util.List<Comment> playerComments)- Parameters:
context- This is the context of the adapterplayerComments- This is the list of comments made by players to be displayed in Listview
-
-
Method Detail
-
getView
@NonNull public android.view.View getView(int position, @Nullable android.view.View convertView, @NonNull android.view.ViewGroup parent)Returns view for each row in the listview- Specified by:
getViewin interfaceandroid.widget.Adapter- Overrides:
getViewin classandroid.widget.ArrayAdapter<Comment>- Parameters:
position- The position of the current item in the listviewconvertView- The view to be convertedparent- The parent View group- Returns:
- return the view for each row in the list view
-
-