Class NewsfeedDetailsAdapter

    • Method Detail

      • setIsUserAllowedToComment

        public void setIsUserAllowedToComment​(boolean isUserAllowedToComment)
        Set the visibility of comment view in SocialWidget
        Parameters:
        isUserAllowedToComment - true to show comment, false to hide comment
      • setIsUserAllowedToPost

        public void setIsUserAllowedToPost​(boolean isUserAllowedToPost)
        Set the visibility of flag view in SocialWidget
        Parameters:
        isUserAllowedToPost - true to show flag, false to hide flag
      • setFlags

        public void setFlags​(java.util.List<Flag> flags)
        Set the list of flags displayed when using Flag view in SocialWidget
        Parameters:
        flags - list of flags used for display
      • setIsProfileClickable

        public void setIsProfileClickable​(boolean isProfileClickable)
        Allows clicking of member avatar/name to show their profile
        Parameters:
        isProfileClickable - true - to allow clicking and showing of profile, false - to disable clicking and showing of profile
      • getItemViewType

        public int getItemViewType​(int position)
        Description copied from class: ListAdapter
        Checker if item type is VIEW_TYPE_HEADER or VIEW_TYPE_NORMAL
        Overrides:
        getItemViewType in class EndlessListAdapter<BaseData,​androidx.recyclerview.widget.RecyclerView.ViewHolder>
        Parameters:
        position - index of the item
        Returns:
        view type in integer format
      • createNormalViewHolder

        protected androidx.recyclerview.widget.RecyclerView.ViewHolder createNormalViewHolder​(android.view.ViewGroup parent,
                                                                                              int viewType)
        Description copied from class: ListAdapter
        Abstract method to create normal view holder.
        Specified by:
        createNormalViewHolder in class ListAdapter<BaseData,​androidx.recyclerview.widget.RecyclerView.ViewHolder>
        Parameters:
        parent - used to get resource
        viewType - type of view
        Returns:
        view holder for non special items
      • bindNormalViewHolder

        protected void bindNormalViewHolder​(androidx.recyclerview.widget.RecyclerView.ViewHolder holder,
                                            int position)
        Description copied from class: ListAdapter
        Abstract method to bind the normal view holder.
        Specified by:
        bindNormalViewHolder in class ListAdapter<BaseData,​androidx.recyclerview.widget.RecyclerView.ViewHolder>
        Parameters:
        holder - view holder to vindS
        position - index of the item
      • removeComment

        public void removeComment​(int commentId)
        Removes comment from the list
        Parameters:
        commentId - id of comment
      • revertCommentChanges

        public void revertCommentChanges​(int commentId)
        Revert changes made in the comment
        Parameters:
        commentId - id of comment
      • updatePost

        public void updatePost​(Post post)
        Updates Post by calling replaceItemAt position 0. First item in the list is always Post
        Parameters:
        post - Updated Post
      • revertPostChanges

        public void revertPostChanges()
        Revert changes made in the post