Package com.cheetahdigital.messages.ui
Class MessagesViewHolder
- java.lang.Object
 - 
- androidx.recyclerview.widget.RecyclerView.ViewHolder
 - 
- com.cheetahdigital.messages.ui.MessagesViewHolder
 
 
 
- 
public class MessagesViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolderThe View Holder for the list of Messages Contains all the views to be displayed on each list item 
- 
- 
Field Summary
Fields Modifier and Type Field Description android.widget.ImageViewmChevronandroid.widget.ImageButtonmDeleteButtonandroid.widget.TextViewmDescriptionandroid.widget.ImageViewmIconandroid.view.ViewmRootViewandroid.widget.TextViewmTimestampandroid.widget.TextViewmTitle 
- 
Constructor Summary
Constructors Constructor Description MessagesViewHolder(android.view.View itemView) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbind(Message message)Populates the details of the current view using the passedMessageintgetMessageAdapterPosition()Returns the Adapter position of the item represented by this ViewHolder.voidsetImagePlaceholder(int placeholder)Set a default placeholder for message image view 
 - 
 
- 
- 
Field Detail
- 
mRootView
public android.view.View mRootView
 
- 
mIcon
public android.widget.ImageView mIcon
 
- 
mTitle
public android.widget.TextView mTitle
 
- 
mDescription
public android.widget.TextView mDescription
 
- 
mTimestamp
public android.widget.TextView mTimestamp
 
- 
mDeleteButton
public android.widget.ImageButton mDeleteButton
 
- 
mChevron
public android.widget.ImageView mChevron
 
 - 
 
- 
Method Detail
- 
bind
public void bind(Message message)
Populates the details of the current view using the passedMessage- Parameters:
 message- instance ofMessageused to populate the item
 
- 
setImagePlaceholder
public void setImagePlaceholder(@DrawableRes int placeholder)Set a default placeholder for message image view- Parameters:
 placeholder- id of the drawable resource
 
- 
getMessageAdapterPosition
public int getMessageAdapterPosition()
Returns the Adapter position of the item represented by this ViewHolder.- Returns:
 - The adapter position of the item if it still exists in the adapter
 
 
 - 
 
 -