Package com.example.airplanned.adapter
Class FlightAdapter
- java.lang.Object
-
- android.widget.BaseAdapter
-
- com.example.airplanned.adapter.FlightAdapter
-
- All Implemented Interfaces:
android.widget.Adapter,android.widget.ListAdapter,android.widget.SpinnerAdapter
public class FlightAdapter extends android.widget.BaseAdapterthe purpose of this class is to adapt the flight objects into a layout for the flight pages functionality- Author:
- Saiyara Iftekharuzzaman
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classFlightAdapter.ViewHolderthis class takes the xml page items and makes them into variables for the adapter to use
-
Constructor Summary
Constructors Constructor Description FlightAdapter(android.content.Context context, List<Flight> flightList)constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfilter(String charText)filters the list by user searchintgetCount()returns the size of the flight listObjectgetItem(int i)returns a flight objectlonggetItemId(int i)returns the list item indexandroid.view.ViewgetView(int position, android.view.View view, android.view.ViewGroup parent)sets the flight object information into a specific flight row layout that was created-
Methods inherited from class android.widget.BaseAdapter
areAllItemsEnabled, getAutofillOptions, getDropDownView, getItemViewType, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetChanged, notifyDataSetInvalidated, registerDataSetObserver, setAutofillOptions, unregisterDataSetObserver
-
-
-
-
Method Detail
-
getCount
public int getCount()
returns the size of the flight list- Returns:
- the flight list size
-
getItem
public Object getItem(int i)
returns a flight object- Parameters:
i- takes an index- Returns:
- the specific flight at that index
-
getItemId
public long getItemId(int i)
returns the list item index- Parameters:
i- index of item- Returns:
- index
-
getView
public android.view.View getView(int position, android.view.View view, android.view.ViewGroup parent)sets the flight object information into a specific flight row layout that was created- Parameters:
position- flight row's positionview- current flight row viewparent- flight row parent- Returns:
- view
-
filter
public void filter(String charText)
filters the list by user search- Parameters:
charText- character the user inputs
-
-