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.ViewHolder
The 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.ImageView
mChevron
android.widget.ImageButton
mDeleteButton
android.widget.TextView
mDescription
android.widget.ImageView
mIcon
android.view.View
mRootView
android.widget.TextView
mTimestamp
android.widget.TextView
mTitle
-
Constructor Summary
Constructors Constructor Description MessagesViewHolder(android.view.View itemView)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(Message message)
Populates the details of the current view using the passedMessage
int
getMessageAdapterPosition()
Returns the Adapter position of the item represented by this ViewHolder.void
setImagePlaceholder(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 ofMessage
used 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
-
-