Class NewsViewHolder
- java.lang.Object
-
- androidx.recyclerview.widget.RecyclerView.ViewHolder
-
- com.cheetahdigital.newsfeed.ui.list.NewsViewHolder
-
public class NewsViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNewsViewHolder.SUPPORTED_VIDEO_TYPESCurrent video types supported.
-
Field Summary
Fields Modifier and Type Field Description android.widget.LinearLayoutmAttachmentsAboveGridViewandroid.widget.LinearLayoutmAttachmentsBelowGridViewandroid.widget.TextViewmContentTextViewandroid.widget.ImageViewmDeleteNewsButtonandroid.widget.TextViewmDurationTextViewLinkPreviewViewmLinkPreviewandroid.widget.ImageViewmPinnedPostButtonandroid.widget.ImageViewmProfileImageViewandroid.widget.TextViewmProfileNameTextViewandroid.view.ViewmRootViewSocialWidgetmSocialWidgetViewShareUrlWidgetmViewShareWidget
-
Constructor Summary
Constructors Constructor Description NewsViewHolder(android.view.View itemView)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbind(Post post, java.util.List<Flag> flags, boolean allowedToComment, boolean allowedToPost)Method to bind and display thePostto theNewsViewHoldervoidsetAttachmentClickListener(OnAttachmentClickListener attachmentClickListener)Set the listener for clicking an attachment (image or video)voidsetPlaceHolderResource(int placeHolderResource)Set the placeholder resource in the avatar view
-
-
-
Field Detail
-
mRootView
public android.view.View mRootView
-
mProfileImageView
public android.widget.ImageView mProfileImageView
-
mProfileNameTextView
public android.widget.TextView mProfileNameTextView
-
mDurationTextView
public android.widget.TextView mDurationTextView
-
mDeleteNewsButton
public android.widget.ImageView mDeleteNewsButton
-
mPinnedPostButton
public android.widget.ImageView mPinnedPostButton
-
mContentTextView
public android.widget.TextView mContentTextView
-
mSocialWidget
public SocialWidget mSocialWidget
-
mViewShareWidget
public ViewShareUrlWidget mViewShareWidget
-
mAttachmentsAboveGridView
public android.widget.LinearLayout mAttachmentsAboveGridView
-
mAttachmentsBelowGridView
public android.widget.LinearLayout mAttachmentsBelowGridView
-
mLinkPreview
public LinkPreviewView mLinkPreview
-
-
Method Detail
-
setAttachmentClickListener
public void setAttachmentClickListener(OnAttachmentClickListener attachmentClickListener)
Set the listener for clicking an attachment (image or video)- Parameters:
attachmentClickListener-OnAttachmentClickListener
-
bind
public void bind(Post post, java.util.List<Flag> flags, boolean allowedToComment, boolean allowedToPost)
Method to bind and display thePostto theNewsViewHolder
-
setPlaceHolderResource
public void setPlaceHolderResource(@DrawableRes int placeHolderResource)Set the placeholder resource in the avatar view- Parameters:
placeHolderResource-DrawableResid of the place holder resource
-
-