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 int
getItemCount()
void
onBindViewHolder(edu.cnm.deepdive.scalescroller.adapter.HighScoreRecyclerAdapter.Holder holder, int position)
edu.cnm.deepdive.scalescroller.adapter.HighScoreRecyclerAdapter.Holder
onCreateViewHolder(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:
onCreateViewHolder
in 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:
onBindViewHolder
in classRecyclerView.Adapter<edu.cnm.deepdive.scalescroller.adapter.HighScoreRecyclerAdapter.Holder>
-
getItemCount
public int getItemCount()
- Specified by:
getItemCount
in classRecyclerView.Adapter<edu.cnm.deepdive.scalescroller.adapter.HighScoreRecyclerAdapter.Holder>
-
-