public class RouteDescriptionListAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter<RouteDescriptionListAdapter.ViewHolder>
Route
elements and the corresponding
view holder items constructed as an instance of RouteDescriptionItem
.Modifier and Type | Class and Description |
---|---|
class |
RouteDescriptionListAdapter.ViewHolder
The view holder for this adapter.
|
Constructor and Description |
---|
RouteDescriptionListAdapter(java.util.List<com.here.android.mpa.routing.Route> routeList)
Constructs a new instance using a list of
Route elements. |
Modifier and Type | Method and Description |
---|---|
int |
getItemCount() |
protected android.view.View |
getRowView(android.content.Context context)
Creates a new
RouteDescriptionItem that can be used as view holder. |
UnitSystem |
getUnitSystem()
Returns current unit system of this adapter.
|
boolean |
isTrafficEnabled()
Gets if total time to arrival should be calculated with traffic.
|
void |
onBindViewHolder(RouteDescriptionListAdapter.ViewHolder holder,
int position) |
RouteDescriptionListAdapter.ViewHolder |
onCreateViewHolder(android.view.ViewGroup parent,
int viewType) |
void |
setTrafficEnabled(boolean isTraffic)
Sets if total time to arrival should be re-calculated including potential traffic delays.
|
void |
setUnitSystem(UnitSystem unitSystem)
Sets unit system of this adapter.
|
bindViewHolder, createViewHolder, findRelativeAdapterPositionIn, getItemId, getItemViewType, getStateRestorationPolicy, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onAttachedToRecyclerView, onBindViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, setHasStableIds, setStateRestorationPolicy, unregisterAdapterDataObserver
public RouteDescriptionListAdapter(java.util.List<com.here.android.mpa.routing.Route> routeList)
Route
elements.routeList
- list of Route
elements.public void setUnitSystem(UnitSystem unitSystem)
unitSystem
- unit system UnitSystem
.public UnitSystem getUnitSystem()
UnitSystem
.public RouteDescriptionListAdapter.ViewHolder onCreateViewHolder(android.view.ViewGroup parent, int viewType)
onCreateViewHolder
in class androidx.recyclerview.widget.RecyclerView.Adapter<RouteDescriptionListAdapter.ViewHolder>
protected android.view.View getRowView(android.content.Context context)
RouteDescriptionItem
that can be used as view holder.
Override this method to customize the use of a custom view holder.
context
- the context to use.RouteDescriptionItem
.public void onBindViewHolder(RouteDescriptionListAdapter.ViewHolder holder, int position)
onBindViewHolder
in class androidx.recyclerview.widget.RecyclerView.Adapter<RouteDescriptionListAdapter.ViewHolder>
public int getItemCount()
getItemCount
in class androidx.recyclerview.widget.RecyclerView.Adapter<RouteDescriptionListAdapter.ViewHolder>
public boolean isTrafficEnabled()
public void setTrafficEnabled(boolean isTraffic)
Please note, setting this to true will call route tta with traffic. For more details please
see Route.getTtaIncludingTraffic(int)
isTraffic
- true if traffic should be enabled, false otherwise.