Class AdminImagesAdapter

java.lang.Object
androidx.recyclerview.widget.RecyclerView.Adapter<AdminImagesAdapter.ViewHolder>
com.example.slacks_lottoevent.viewmodel.adapter.AdminImagesAdapter

public class AdminImagesAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter<AdminImagesAdapter.ViewHolder>
Custom ArrayAdapter for displaying event posters and profile pictures in a RecyclerView.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

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

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

    Constructors
    Constructor
    Description
    AdminImagesAdapter(android.content.Context context, List<ImageMetadata> imageList)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    deleteImageFromFirestore(android.content.Context context, com.google.firebase.firestore.FirebaseFirestore db, String ImageURL, boolean isPoster)
     
    static void
    deleteImageFromStorageAndFirestore(android.content.Context context, String ImageURL)
     
    int
     
    void
     
    onCreateViewHolder(android.view.ViewGroup parent, int viewType)
     
    static void
    showImageOptionsDialog(android.content.Context context, com.google.firebase.firestore.FirebaseFirestore db, String ImageURL, boolean isPoster)
    Shows a dialog with event name and location, and options to Cancel or Delete the image.

    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

    • AdminImagesAdapter

      public AdminImagesAdapter(android.content.Context context, List<ImageMetadata> imageList)
  • Method Details

    • showImageOptionsDialog

      public static void showImageOptionsDialog(android.content.Context context, com.google.firebase.firestore.FirebaseFirestore db, String ImageURL, boolean isPoster)
      Shows a dialog with event name and location, and options to Cancel or Delete the image.
    • deleteImageFromFirestore

      public static void deleteImageFromFirestore(android.content.Context context, com.google.firebase.firestore.FirebaseFirestore db, String ImageURL, boolean isPoster)
    • deleteImageFromStorageAndFirestore

      public static void deleteImageFromStorageAndFirestore(android.content.Context context, String ImageURL)
    • onCreateViewHolder

      @NonNull public AdminImagesAdapter.ViewHolder onCreateViewHolder(@NonNull android.view.ViewGroup parent, int viewType)
      Specified by:
      onCreateViewHolder in class androidx.recyclerview.widget.RecyclerView.Adapter<AdminImagesAdapter.ViewHolder>
    • onBindViewHolder

      public void onBindViewHolder(@NonNull AdminImagesAdapter.ViewHolder holder, int position)
      Specified by:
      onBindViewHolder in class androidx.recyclerview.widget.RecyclerView.Adapter<AdminImagesAdapter.ViewHolder>
    • getItemCount

      public int getItemCount()
      Specified by:
      getItemCount in class androidx.recyclerview.widget.RecyclerView.Adapter<AdminImagesAdapter.ViewHolder>