Class OffersViewHolder

  • Direct Known Subclasses:
    SwipeOffersViewHolder

    public class OffersViewHolder
    extends androidx.recyclerview.widget.RecyclerView.ViewHolder
    The RecyclerView.ViewHolder class for OffersListFragment
    • Field Summary

      Fields 
      Modifier and Type Field Description
      android.widget.ImageView mAvatar  
      android.widget.TextView mBody  
      android.view.View mContainer  
      android.widget.TextView mDetails  
      android.widget.TextView mName  
      android.widget.TextView mSubheading  
      • Fields inherited from class androidx.recyclerview.widget.RecyclerView.ViewHolder

        itemView
    • Constructor Summary

      Constructors 
      Constructor Description
      OffersViewHolder​(android.view.View itemView)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void bind​(Offer offer)
      Method to bind and display the Offer to the OffersViewHolder
      void setEnableShowImageOnBackground​(boolean showImageOnBackground)
      Set the flag for enabling the image on background of the container
      void setPlaceHolderResource​(int placeHolderResource)
      Set the placeholder resource in the avatar view
      • Methods inherited from class androidx.recyclerview.widget.RecyclerView.ViewHolder

        getAdapterPosition, getItemId, getItemViewType, getLayoutPosition, getOldPosition, getPosition, isRecyclable, setIsRecyclable, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • mContainer

        public android.view.View mContainer
      • mName

        public android.widget.TextView mName
      • mAvatar

        public android.widget.ImageView mAvatar
      • mSubheading

        public android.widget.TextView mSubheading
      • mBody

        public android.widget.TextView mBody
      • mDetails

        public android.widget.TextView mDetails
    • Constructor Detail

      • OffersViewHolder

        public OffersViewHolder​(android.view.View itemView)
    • Method Detail

      • setPlaceHolderResource

        public void setPlaceHolderResource​(@DrawableRes
                                           int placeHolderResource)
        Set the placeholder resource in the avatar view
        Parameters:
        placeHolderResource - DrawableRes id of the place holder resource
      • setEnableShowImageOnBackground

        public void setEnableShowImageOnBackground​(boolean showImageOnBackground)
        Set the flag for enabling the image on background of the container
        Parameters:
        showImageOnBackground - true to enable showing of image on background, else false