Class TransactionViewHolder


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

      Fields 
      Modifier and Type Field Description
      android.widget.TextView descriptionTextView  
      android.widget.ImageView iconImageView  
      android.widget.TextView labelTextView  
      • Fields inherited from class androidx.recyclerview.widget.RecyclerView.ViewHolder

        itemView
    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void bind​(Transaction transaction)
      Method to bind and display the Transaction to the TransactionViewHolder
      void setImageAndLabel​(android.graphics.drawable.Drawable image, int label)
      Sets the image and label of the transaction
      void setImageAndLabelWithAmount​(android.graphics.drawable.Drawable image, java.lang.String amount, int label)
      Sets the image and label of the transaction with corresponding amount
      • 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

      • iconImageView

        public android.widget.ImageView iconImageView
      • labelTextView

        public android.widget.TextView labelTextView
      • descriptionTextView

        public android.widget.TextView descriptionTextView
    • Constructor Detail

      • TransactionViewHolder

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

      • setImageAndLabel

        public void setImageAndLabel​(android.graphics.drawable.Drawable image,
                                     @StringRes
                                     int label)
        Sets the image and label of the transaction
        Parameters:
        image - image of transaction
        label - label of transaction
      • setImageAndLabelWithAmount

        public void setImageAndLabelWithAmount​(android.graphics.drawable.Drawable image,
                                               java.lang.String amount,
                                               @StringRes
                                               int label)
        Sets the image and label of the transaction with corresponding amount
        Parameters:
        image - image of transaction
        amount - amount of transaction
        label - label of transaction