Class NotificationLogAdapter

java.lang.Object
androidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.NotificationLogAdapter.LogViewHolder>
com.example.lottery.adapter.NotificationLogAdapter

public class NotificationLogAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.NotificationLogAdapter.LogViewHolder>
Displays organizer notification logs in the admin log browser.
  • Nested Class Summary

    Nested classes/interfaces inherited from class androidx.recyclerview.widget.RecyclerView.Adapter

    androidx.recyclerview.widget.RecyclerView.Adapter.StateRestorationPolicy
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the total number of log items.
    void
    onBindViewHolder(com.example.lottery.adapter.NotificationLogAdapter.LogViewHolder holder, int position)
    Binds log data to the given ViewHolder.
    com.example.lottery.adapter.NotificationLogAdapter.LogViewHolder
    onCreateViewHolder(android.view.ViewGroup parent, int viewType)
    Creates a new ViewHolder for a log item.

    Methods 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NotificationLogAdapter

      public NotificationLogAdapter(List<Map<String,Object>> logList)
      Parameters:
      logList - raw Firestore document data for each notification log
  • Method Details

    • onCreateViewHolder

      @NonNull public com.example.lottery.adapter.NotificationLogAdapter.LogViewHolder onCreateViewHolder(@NonNull android.view.ViewGroup parent, int viewType)
      Creates a new ViewHolder for a log item.
      Specified by:
      onCreateViewHolder in class androidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.NotificationLogAdapter.LogViewHolder>
      Parameters:
      parent - the parent view group
      viewType - the view type
      Returns:
      a new NotificationLogAdapter.LogViewHolder
    • onBindViewHolder

      public void onBindViewHolder(@NonNull com.example.lottery.adapter.NotificationLogAdapter.LogViewHolder holder, int position)
      Binds log data to the given ViewHolder.
      Specified by:
      onBindViewHolder in class androidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.NotificationLogAdapter.LogViewHolder>
      Parameters:
      holder - the ViewHolder to bind
      position - the position in the list
    • getItemCount

      public int getItemCount()
      Returns the total number of log items.
      Specified by:
      getItemCount in class androidx.recyclerview.widget.RecyclerView.Adapter<com.example.lottery.adapter.NotificationLogAdapter.LogViewHolder>
      Returns:
      size of the log list