Class 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 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

      • onBindViewHolder

        public void onBindViewHolder​(@NonNull
                                     edu.cnm.deepdive.scalescroller.adapter.HighScoreRecyclerAdapter.Holder holder,
                                     int position)
        Specified by:
        onBindViewHolder in class RecyclerView.Adapter<edu.cnm.deepdive.scalescroller.adapter.HighScoreRecyclerAdapter.Holder>
      • getItemCount

        public int getItemCount()
        Specified by:
        getItemCount in class RecyclerView.Adapter<edu.cnm.deepdive.scalescroller.adapter.HighScoreRecyclerAdapter.Holder>