Class TransactionViewHolder
- java.lang.Object
-
- androidx.recyclerview.widget.RecyclerView.ViewHolder
-
- com.cheetahdigital.giftcards.ui.history.TransactionViewHolder
-
public class TransactionViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder
The View Holder for the list ofTransaction
. 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
-
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 theTransaction
to theTransactionViewHolder
void
setImageAndLabel(android.graphics.drawable.Drawable image, int label)
Sets the image and label of the transactionvoid
setImageAndLabelWithAmount(android.graphics.drawable.Drawable image, java.lang.String amount, int label)
Sets the image and label of the transaction with corresponding amount
-
-
-
Method Detail
-
bind
public void bind(Transaction transaction)
Method to bind and display theTransaction
to theTransactionViewHolder
- Parameters:
transaction
- theTransaction
to display
-
setImageAndLabel
public void setImageAndLabel(android.graphics.drawable.Drawable image, @StringRes int label)
Sets the image and label of the transaction- Parameters:
image
- image of transactionlabel
- 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 transactionamount
- amount of transactionlabel
- label of transaction
-
-