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 interface
Interface for handling QR code item clicks.static class
ViewHolder for QR code items. -
Constructor Summary
ConstructorsConstructorDescriptionQRCodeGalleryAdapter
(android.content.Context context, List<QRCodeData> qrCodeList, QRCodeGalleryAdapter.QRCodeClickListener qrCodeClickListener) Constructor for QRCodeGalleryAdapter. -
Method Summary
Modifier and TypeMethodDescriptionint
void
onBindViewHolder
(QRCodeGalleryAdapter.QRCodeViewHolder holder, int position) onCreateViewHolder
(android.view.ViewGroup parent, int viewType) void
updateQRCodeList
(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:
onCreateViewHolder
in classandroidx.recyclerview.widget.RecyclerView.Adapter<QRCodeGalleryAdapter.QRCodeViewHolder>
-
onBindViewHolder
- Specified by:
onBindViewHolder
in classandroidx.recyclerview.widget.RecyclerView.Adapter<QRCodeGalleryAdapter.QRCodeViewHolder>
-
getItemCount
public int getItemCount()- Specified by:
getItemCount
in classandroidx.recyclerview.widget.RecyclerView.Adapter<QRCodeGalleryAdapter.QRCodeViewHolder>
-
updateQRCodeList
Update the QR code list dynamically.- Parameters:
newQRCodeList
- New list of QR codes.
-