Package com.example.breeze_seas
Class AdminBrowseLogsAdapter
java.lang.Object
androidx.recyclerview.widget.RecyclerView.Adapter<AdminBrowseLogsAdapter.LogViewHolder>
com.example.breeze_seas.AdminBrowseLogsAdapter
public class AdminBrowseLogsAdapter
extends androidx.recyclerview.widget.RecyclerView.Adapter<AdminBrowseLogsAdapter.LogViewHolder>
Adapter for displaying list of all notifications sent to users.
Binds
Notification data to the corresponding UI layout.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHolds references to the UI components for a single log/notification to avoid repeated findViewById calls.Nested classes/interfaces inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
androidx.recyclerview.widget.RecyclerView.Adapter.StateRestorationPolicy -
Constructor Summary
ConstructorsConstructorDescriptionAdminBrowseLogsAdapter(List<Notification> logList) Constructor for the adapter -
Method Summary
Modifier and TypeMethodDescriptionintReturns the total number of notifications/logs in the current data set.voidonBindViewHolder(AdminBrowseLogsAdapter.LogViewHolder holder, int position) Binds the data from aNotificationobject to the views within theAdminBrowseLogsAdapter.LogViewHolder.onCreateViewHolder(android.view.ViewGroup parent, int viewType) Inflates the layout for individual log items in the RecyclerView.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
-
Constructor Details
-
AdminBrowseLogsAdapter
Constructor for the adapter- Parameters:
logList- The list ofNotificationobjects to be displayed.
-
-
Method Details
-
onCreateViewHolder
@NonNull public AdminBrowseLogsAdapter.LogViewHolder onCreateViewHolder(@NonNull android.view.ViewGroup parent, int viewType) Inflates the layout for individual log items in the RecyclerView.- Specified by:
onCreateViewHolderin classandroidx.recyclerview.widget.RecyclerView.Adapter<AdminBrowseLogsAdapter.LogViewHolder>
-
onBindViewHolder
Binds the data from aNotificationobject to the views within theAdminBrowseLogsAdapter.LogViewHolder.- Specified by:
onBindViewHolderin classandroidx.recyclerview.widget.RecyclerView.Adapter<AdminBrowseLogsAdapter.LogViewHolder>
-
getItemCount
public int getItemCount()Returns the total number of notifications/logs in the current data set.- Specified by:
getItemCountin classandroidx.recyclerview.widget.RecyclerView.Adapter<AdminBrowseLogsAdapter.LogViewHolder>
-