Class GiftcardsViewHolder


  • public class GiftcardsViewHolder
    extends androidx.recyclerview.widget.RecyclerView.ViewHolder
    The View Holder for the list of Giftcard Contains all the views to be displayed on each list item
    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void bind​(Giftcard giftcard)
      Method to bind and display the Giftcard to the GiftcardsViewHolder
      protected java.lang.String formatDaysLeft​(int daysLeft)
      Formats the days left based on the usage end date of the gift card.
      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

      • mRootView

        public android.view.View mRootView
      • mThumbImageView

        public android.widget.ImageView mThumbImageView
      • mCardNumber

        public android.widget.TextView mCardNumber
      • mGiftCardName

        public android.widget.TextView mGiftCardName
      • mGiftCardDescription

        public android.widget.TextView mGiftCardDescription
      • mGiftCardBalance

        public android.widget.TextView mGiftCardBalance
      • mGiftCardExpiration

        public android.widget.TextView mGiftCardExpiration
      • mGiftCardDaysLeft

        public android.widget.TextView mGiftCardDaysLeft
      • mGiftCardLabel

        public android.widget.TextView mGiftCardLabel
    • Constructor Detail

      • GiftcardsViewHolder

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

      • formatDaysLeft

        @NonNull
        protected java.lang.String formatDaysLeft​(int daysLeft)
        Formats the days left based on the usage end date of the gift card. Default format is using R.plurals.days_left. Override this method to change the default display of days left.
        Parameters:
        daysLeft - number of days left
        Returns:
        formatted number of days left
      • setPlaceHolderResource

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