Package com.example.iconic_raffleevent
Class QRCodeGalleryAdapter
java.lang.Object
androidx.recyclerview.widget.RecyclerView.Adapter<QRCodeGalleryAdapter.QRCodeViewHolder>
com.example.iconic_raffleevent.QRCodeGalleryAdapter
public class QRCodeGalleryAdapter
extends androidx.recyclerview.widget.RecyclerView.Adapter<QRCodeGalleryAdapter.QRCodeViewHolder>
Adapter for displaying QR codes in a RecyclerView.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface for handling QR code item clicks.static classViewHolder for QR code items. -
Constructor Summary
ConstructorsConstructorDescriptionQRCodeGalleryAdapter(android.content.Context context, List<QRCodeData> qrCodeList, QRCodeGalleryAdapter.QRCodeClickListener qrCodeClickListener) Constructor for QRCodeGalleryAdapter. -
Method Summary
Modifier and TypeMethodDescriptionintvoidonBindViewHolder(QRCodeGalleryAdapter.QRCodeViewHolder holder, int position) onCreateViewHolder(android.view.ViewGroup parent, int viewType) voidupdateQRCodeList(List<QRCodeData> newQRCodeList) Update the QR code list dynamically.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 Details
-
QRCodeGalleryAdapter
public QRCodeGalleryAdapter(android.content.Context context, List<QRCodeData> qrCodeList, QRCodeGalleryAdapter.QRCodeClickListener qrCodeClickListener) Constructor for QRCodeGalleryAdapter.- Parameters:
context- The application context.qrCodeList- List of QRCodeData objects to display.qrCodeClickListener- Listener for QR code item clicks.
-
-
Method Details
-
onCreateViewHolder
@NonNull public QRCodeGalleryAdapter.QRCodeViewHolder onCreateViewHolder(@NonNull android.view.ViewGroup parent, int viewType) - Specified by:
onCreateViewHolderin classandroidx.recyclerview.widget.RecyclerView.Adapter<QRCodeGalleryAdapter.QRCodeViewHolder>
-
onBindViewHolder
- Specified by:
onBindViewHolderin classandroidx.recyclerview.widget.RecyclerView.Adapter<QRCodeGalleryAdapter.QRCodeViewHolder>
-
getItemCount
public int getItemCount()- Specified by:
getItemCountin classandroidx.recyclerview.widget.RecyclerView.Adapter<QRCodeGalleryAdapter.QRCodeViewHolder>
-
updateQRCodeList
Update the QR code list dynamically.- Parameters:
newQRCodeList- New list of QR codes.
-