Class ScaleRecyclerAdapter


  • public class ScaleRecyclerAdapter
    extends RecyclerView.Adapter<edu.cnm.deepdive.scalescroller.adapter.ScaleRecyclerAdapter.Holder>
    Allows for the scales in the database to be listed in a RecyclerView.
    • Constructor Detail

      • ScaleRecyclerAdapter

        public ScaleRecyclerAdapter​(@NonNull
                                    Context context,
                                    List<Scale> scales,
                                    ScaleRecyclerAdapter.OnScaleClickListener listener,
                                    int highestDifficulty)
        The constructor initializes the context, the list of scales, an onClickListener, and the highest difficulty scale the current player has access to.
        Parameters:
        context - The application context.
        scales - A List of Scale to be displayed.
        listener - A type of onClickListener.
        highestDifficulty - The highest difficulty scale the current player has access to.
    • Method Detail

      • onBindViewHolder

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

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