Class HighScoreRecyclerAdapter
- java.lang.Object
-
- androidx.recyclerview.widget.RecyclerView.Adapter<edu.cnm.deepdive.scalescroller.adapter.HighScoreRecyclerAdapter.Holder>
-
- edu.cnm.deepdive.scalescroller.adapter.HighScoreRecyclerAdapter
-
public class HighScoreRecyclerAdapter extends RecyclerView.Adapter<edu.cnm.deepdive.scalescroller.adapter.HighScoreRecyclerAdapter.Holder>
Allows for the highest scores from the database to be listed in a RecyclerView.
-
-
Constructor Summary
Constructors Constructor Description HighScoreRecyclerAdapter(Context context, List<ChallengeAttemptWithPlayer> highScoreAttempts)The constructor initializes the context and the list of high-scoring attempts.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetItemCount()voidonBindViewHolder(edu.cnm.deepdive.scalescroller.adapter.HighScoreRecyclerAdapter.Holder holder, int position)edu.cnm.deepdive.scalescroller.adapter.HighScoreRecyclerAdapter.HolderonCreateViewHolder(ViewGroup parent, int viewType)-
Methods inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
bindViewHolder, createViewHolder, getItemId, getItemViewType, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onAttachedToRecyclerView, onBindViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, setHasStableIds, unregisterAdapterDataObserver
-
-
-
-
Constructor Detail
-
HighScoreRecyclerAdapter
public HighScoreRecyclerAdapter(@NonNull Context context, List<ChallengeAttemptWithPlayer> highScoreAttempts)
The constructor initializes the context and the list of high-scoring attempts.- Parameters:
context- The application context.highScoreAttempts- The list of high-scoring attempts.
-
-
Method Detail
-
onCreateViewHolder
@NonNull public edu.cnm.deepdive.scalescroller.adapter.HighScoreRecyclerAdapter.Holder onCreateViewHolder(@NonNull ViewGroup parent, int viewType)
- Specified by:
onCreateViewHolderin classRecyclerView.Adapter<edu.cnm.deepdive.scalescroller.adapter.HighScoreRecyclerAdapter.Holder>
-
onBindViewHolder
public void onBindViewHolder(@NonNull edu.cnm.deepdive.scalescroller.adapter.HighScoreRecyclerAdapter.Holder holder, int position)
- Specified by:
onBindViewHolderin classRecyclerView.Adapter<edu.cnm.deepdive.scalescroller.adapter.HighScoreRecyclerAdapter.Holder>
-
getItemCount
public int getItemCount()
- Specified by:
getItemCountin classRecyclerView.Adapter<edu.cnm.deepdive.scalescroller.adapter.HighScoreRecyclerAdapter.Holder>
-
-