Package com.example.lottery.adapter
Class SignedUpListAdapter
java.lang.Object
androidx.recyclerview.widget.RecyclerView.Adapter<SignedUpListAdapter.ViewHolder>
com.example.lottery.adapter.SignedUpListAdapter
public class SignedUpListAdapter
extends androidx.recyclerview.widget.RecyclerView.Adapter<SignedUpListAdapter.ViewHolder>
Adapter for signed up entrants RecyclerView to display a list of entrants that signed up the specific event
Responsibilities:
- bind data to signed up entrants recyclerview
- render each piece of data
- handle user interaction
- implement US 02.06.01 Be able to view all chosen entrants
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassstores and recycles views as they are scrolled off screenNested classes/interfaces inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
androidx.recyclerview.widget.RecyclerView.Adapter.StateRestorationPolicy -
Constructor Summary
ConstructorsConstructorDescriptionSignedUpListAdapter(android.content.Context context, List<EntrantEvent> data) data is passed into the constructor -
Method Summary
Modifier and TypeMethodDescriptionintvoidonBindViewHolder(SignedUpListAdapter.ViewHolder holder, int position) get total number of rowsonCreateViewHolder(android.view.ViewGroup parent, int viewType) inflates the row layout from xml when neededMethods inherited from class androidx.recyclerview.widget.RecyclerView.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
-
Constructor Details
-
SignedUpListAdapter
data is passed into the constructor- Parameters:
context- context we want to interactdata- data we will manipulate to display
-
-
Method Details
-
onCreateViewHolder
@NonNull public SignedUpListAdapter.ViewHolder onCreateViewHolder(android.view.ViewGroup parent, int viewType) inflates the row layout from xml when needed- Specified by:
onCreateViewHolderin classandroidx.recyclerview.widget.RecyclerView.Adapter<SignedUpListAdapter.ViewHolder>- Parameters:
parent- The ViewGroup into which the new View will be added after it is bound to an adapter position.viewType- The view type of the new View.- Returns:
-
onBindViewHolder
get total number of rows- Specified by:
onBindViewHolderin classandroidx.recyclerview.widget.RecyclerView.Adapter<SignedUpListAdapter.ViewHolder>
-
getItemCount
public int getItemCount()- Specified by:
getItemCountin classandroidx.recyclerview.widget.RecyclerView.Adapter<SignedUpListAdapter.ViewHolder>
-