Package com.example.airplanned.adapter
Class HotelListAdapter
- java.lang.Object
-
- android.widget.BaseAdapter
-
- android.widget.ArrayAdapter<Hotel>
-
- com.example.airplanned.adapter.HotelListAdapter
-
- All Implemented Interfaces:
android.widget.Adapter
,android.widget.Filterable
,android.widget.ListAdapter
,android.widget.SpinnerAdapter
,android.widget.ThemedSpinnerAdapter
public class HotelListAdapter extends android.widget.ArrayAdapter<Hotel>
The purpose of this class is to format the hotel page and view- Author:
- Julie Duong
-
-
Constructor Summary
Constructors Constructor Description HotelListAdapter(android.content.Context context, int resource, ArrayList<Hotel> objects)
This constructor is to include context of the page
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description android.view.View
getView(int position, android.view.View convertView, android.view.ViewGroup parent)
this View method is overrided from ArrayAdapter to get View for display the RecycleView-
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
-
-
-
-
Method Detail
-
getView
@NonNull public android.view.View getView(int position, android.view.View convertView, android.view.ViewGroup parent)
this View method is overrided from ArrayAdapter to get View for display the RecycleView- Specified by:
getView
in interfaceandroid.widget.Adapter
- Overrides:
getView
in classandroid.widget.ArrayAdapter<Hotel>
- Parameters:
position
- The position of the item within the adapter's data set of the item whose view we want.convertView
- The old view to reuse, if possible. Note: You should check that this view is non-null and of an appropriate type before using. If it is not possible to convert this view to display the correct data, this method can create a new view. Heterogeneous lists can specify their number of view types, so that this View is always of the right type (seeAdapter.getViewTypeCount()
andAdapter.getItemViewType(int)
).parent
- The parent that this view will eventually be attached to- Returns:
- A View corresponding to the data at the specified position.
-
-