Class 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
    • Field Summary

      • Fields inherited from interface android.widget.Adapter

        IGNORE_ITEM_VIEW_TYPE, NO_SELECTION
    • 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
      • Methods inherited from interface android.widget.Adapter

        getItemViewType, getViewTypeCount, hasStableIds, isEmpty, registerDataSetObserver, unregisterDataSetObserver
    • Constructor Detail

      • HotelListAdapter

        public HotelListAdapter​(android.content.Context context,
                                int resource,
                                ArrayList<Hotel> objects)
        This constructor is to include context of the page
    • 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 interface android.widget.Adapter
        Overrides:
        getView in class android.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 (see Adapter.getViewTypeCount() and Adapter.getItemViewType(int)).
        parent - The parent that this view will eventually be attached to
        Returns:
        A View corresponding to the data at the specified position.