public class WaypointListAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter<WaypointListAdapter.WaypointsListViewHolder>
WaypointEntry
list and the WaypointListAdapter.WaypointsListViewHolder
views that will be shown in a WaypointList
.Modifier and Type | Class and Description |
---|---|
class |
WaypointListAdapter.WaypointsListViewHolder
The view holder used for this adapter.
|
Constructor and Description |
---|
WaypointListAdapter(java.util.List<WaypointEntry> entries)
Constructs a new instance using a list of
WaypointEntry elements. |
Modifier and Type | Method and Description |
---|---|
int |
getItemCount() |
void |
onAttachedToRecyclerView(androidx.recyclerview.widget.RecyclerView recyclerView) |
void |
onBindViewHolder(WaypointListAdapter.WaypointsListViewHolder holder,
int position) |
WaypointListAdapter.WaypointsListViewHolder |
onCreateViewHolder(android.view.ViewGroup parent,
int viewType) |
void |
setListener(WaypointList.Listener listener)
Sets a listener to get notified on user interactions done on the
WaypointList . |
bindViewHolder, createViewHolder, findRelativeAdapterPositionIn, getItemId, getItemViewType, getStateRestorationPolicy, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onBindViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, setHasStableIds, setStateRestorationPolicy, unregisterAdapterDataObserver
public WaypointListAdapter(@NonNull java.util.List<WaypointEntry> entries)
WaypointEntry
elements.entries
- a list of WaypointEntry
objects.public void onAttachedToRecyclerView(androidx.recyclerview.widget.RecyclerView recyclerView)
onAttachedToRecyclerView
in class androidx.recyclerview.widget.RecyclerView.Adapter<WaypointListAdapter.WaypointsListViewHolder>
public int getItemCount()
getItemCount
in class androidx.recyclerview.widget.RecyclerView.Adapter<WaypointListAdapter.WaypointsListViewHolder>
public WaypointListAdapter.WaypointsListViewHolder onCreateViewHolder(android.view.ViewGroup parent, int viewType)
onCreateViewHolder
in class androidx.recyclerview.widget.RecyclerView.Adapter<WaypointListAdapter.WaypointsListViewHolder>
public void onBindViewHolder(WaypointListAdapter.WaypointsListViewHolder holder, int position)
onBindViewHolder
in class androidx.recyclerview.widget.RecyclerView.Adapter<WaypointListAdapter.WaypointsListViewHolder>
public void setListener(WaypointList.Listener listener)
WaypointList
.listener
- the listener to set.