package com.gh.gamecenter.message.view.message;

import android.content.Context;
import android.content.Intent;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentActivity;

import com.gh.gamecenter.common.base.BaseRecyclerViewHolder;
import com.gh.gamecenter.common.base.activity.BaseActivity;
import com.gh.gamecenter.common.base.fragment.BaseFragment_TabLayout;
import com.gh.gamecenter.common.callback.OnListClickListener;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.common.constant.EntranceConsts;
import com.gh.gamecenter.common.constant.RouteConsts;
import com.gh.gamecenter.common.entity.CommunityEntity;
import com.gh.gamecenter.common.exposure.ExposureSource;
import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.utils.ImageUtils;
import com.gh.gamecenter.common.utils.SensorsBridge;
import com.gh.gamecenter.common.utils.TextHelper;
import com.gh.gamecenter.core.provider.IDirectProvider;
import com.gh.gamecenter.core.provider.IWebProvider;
import com.gh.gamecenter.core.utils.ClickUtils;
import com.gh.gamecenter.core.utils.DisplayUtils;
import com.gh.gamecenter.core.utils.GsonUtils;
import com.gh.gamecenter.core.utils.MtaHelper;
import com.gh.gamecenter.feature.entity.MessageEntity;
import com.gh.gamecenter.feature.entity.Questions;
import com.gh.gamecenter.feature.entity.UserEntity;
import com.gh.gamecenter.feature.provider.ICommentDetailProvider;
import com.gh.gamecenter.feature.provider.ICommentUtilsProvider;
import com.gh.gamecenter.feature.provider.IGameCollectionDetailProvider;
import com.gh.gamecenter.feature.provider.IGameDetailProvider;
import com.gh.gamecenter.feature.provider.IMessageDetailProvider;
import com.gh.gamecenter.feature.provider.INewCommentDetailProvider;
import com.gh.gamecenter.feature.provider.ISimpleAnswerDetailProvider;
import com.gh.gamecenter.login.user.UserManager;
import com.gh.gamecenter.message.R;
import com.gh.gamecenter.message.databinding.MessageItemBinding;
import com.gh.gamecenter.message.entity.MessageFold;
import com.gh.gamecenter.message.retrofit.RetrofitManager;
import com.gh.gamecenter.message.utils.NewLogUtils;
import com.lightgame.utils.Utils;
import com.therouter.TheRouter;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import retrofit2.HttpException;

/**
 * Created by khy on 23/03/18.
 */

public class MessageItemViewHolder extends BaseRecyclerViewHolder<MessageEntity> {
    MessageItemBinding mBinding;

    // 外层信息，MTA 用
    private String mOuterInfo;

    private final static String LABEL_REGEX = "<tag>(\\S+)</tag>([\\S\\s\n]+)";

    public MessageItemViewHolder(MessageItemBinding binding,
                                 OnListClickListener listClickListener,
                                 String outerInfo) {
        super(binding.getRoot(), listClickListener);
        mOuterInfo = outerInfo;
        mBinding = binding;
        mBinding.messageOriginal.setOnClickListener(this);
        mBinding.messageItem.setOnClickListener(this);
    }

    public void setMessageItem(MessageEntity messageEntity, Context context, String entrance) {
        mBinding.messageItem.setBackground(ContextCompat.getDrawable(mBinding.getRoot().getContext(), com.gh.gamecenter.common.R.drawable.reuse_listview_item_style));
        mBinding.messageOriginal.setBackground(ContextCompat.getDrawable(mBinding.getRoot().getContext(), com.gh.gamecenter.common.R.drawable.bg_shape_space_radius_8));
        mBinding.messageUserName.setTextColor(ContextCompat.getColor(mBinding.getRoot().getContext(), com.gh.gamecenter.common.R.color.text_primary));
        mBinding.messageUserMore.setTextColor(ContextCompat.getColor(mBinding.getRoot().getContext(), com.gh.gamecenter.common.R.color.text_theme));
        mBinding.messageCommand.setTextColor(ContextCompat.getColor(mBinding.getRoot().getContext(), com.gh.gamecenter.common.R.color.text_primary));
        mBinding.messageTime.setTextColor(ContextCompat.getColor(mBinding.getRoot().getContext(), com.gh.gamecenter.common.R.color.text_tertiary));
        mBinding.messageContent.setTextColor(ContextCompat.getColor(mBinding.getRoot().getContext(), com.gh.gamecenter.common.R.color.text_secondary));
        mBinding.messageOriginalTitle.setTextColor(ContextCompat.getColor(mBinding.getRoot().getContext(), com.gh.gamecenter.common.R.color.text_tertiary));

        setClickData(messageEntity);
        if (messageEntity.getUserEntity().getAuth() != null) {
            mBinding.messageUserIcon.display(messageEntity.getUserEntity().getBorder(), messageEntity.getUserEntity().getIcon(), messageEntity.getUserEntity().getAuth().getIcon());
        } else {
            mBinding.messageUserIcon.display(messageEntity.getUserEntity().getBorder(), messageEntity.getUserEntity().getIcon(), null);
        }
        ExtensionsKt.goneIf(mBinding.messageUnread, messageEntity.getRead());
        mBinding.messageUserName.setText(messageEntity.getUserEntity().getName());

        ICommentUtilsProvider commentUtils = TheRouter.get(ICommentUtilsProvider.class);
        if (commentUtils != null) {
            mBinding.messageTime.setText(commentUtils.getCommentTime(messageEntity.getTime()));
        }
        List<String> images;
        List<MessageEntity.Video> videos;
        String targetUrl = null; // 防止串行
        String imageCommentStr = "[图片评论]";
        String content = "";
        switch (messageEntity.getType()) {
            case "answer":
                mBinding.messageCommand.setText("回答了你的问题");
                mBinding.messageContent.setVisibility(View.VISIBLE);
                content = messageEntity.getAnswer().getContent();
                mBinding.messageOriginalTitle.setText(messageEntity.getQuestion().getTitle());
                videos = messageEntity.getQuestion().getVideos();
                if (videos.size() > 0) {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, videos.get(0).getPoster());
                } else {
                    images = messageEntity.getQuestion().getImages();
                    if (images.size() > 0) {
                        mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                        ImageUtils.display(mBinding.messageOriginalIcon, images.get(0));
                    } else {
                        mBinding.messageOriginalIcon.setVisibility(View.GONE);
                    }
                }
                voteMoreUser(messageEntity);
                break;
            case "reply":
                mBinding.messageCommand.setText("回复了你");
                mBinding.messageContent.setVisibility(View.VISIBLE);
                content = messageEntity.getDialogue().getFrom().getContent();
                mBinding.messageOriginalTitle.setText(messageEntity.getDialogue().getTo().getContent());
                targetUrl = messageEntity.getArticle().getThumb();
                if (TextUtils.isEmpty(targetUrl)) {
                    mBinding.messageOriginalIcon.setVisibility(View.GONE);
                } else {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, targetUrl);
                }
                voteMoreUser(messageEntity);
                break;
            case "follow_question":
                mBinding.messageCommand.setText("回答了你关注的问题");
                mBinding.messageContent.setVisibility(View.VISIBLE);
                content = messageEntity.getAnswer().getContent();
                mBinding.messageOriginalTitle.setText(messageEntity.getQuestion().getTitle());
                images = messageEntity.getAnswer().getImages();
                if (images.size() > 0) {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, images.get(0));
                } else {
                    mBinding.messageOriginalIcon.setVisibility(View.GONE);
                }
                voteMoreUser(messageEntity);
                break;
            case "reply_answer_comment":
                mBinding.messageCommand.setText("回复了你");
                mBinding.messageContent.setVisibility(View.VISIBLE);
                content = messageEntity.getDialogue().getFrom().getContent();
                mBinding.messageOriginalTitle.setText(messageEntity.getDialogue().getTo().getContent());
                mBinding.messageOriginalIcon.setVisibility(View.GONE);
                voteMoreUser(messageEntity);
                break;
            case "answer_comment":
                mBinding.messageCommand.setText("回复了你的回答");
                mBinding.messageContent.setVisibility(View.VISIBLE);
                content = messageEntity.getComment().getContent();
                if (messageEntity.getAnswer().getContent() != null) {
                    mBinding.messageOriginalTitle.setText(messageEntity.getAnswer().getContent().replace(imageCommentStr, ""));
                }
                images = messageEntity.getAnswer().getImages();
                if (images.size() > 0) {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, images.get(0));
                } else {
                    mBinding.messageOriginalIcon.setVisibility(View.GONE);
                }
                voteMoreUser(messageEntity);
                break;
            case "answer_vote":
                mBinding.messageCommand.setText("赞同你的回答");
                mBinding.messageContent.setVisibility(View.GONE);
                if (messageEntity.getAnswer().getContent() != null) {
                    mBinding.messageOriginalTitle.setText(messageEntity.getAnswer().getContent().replace(imageCommentStr, ""));
                }
                images = messageEntity.getAnswer().getImages();
                if (images.size() > 0) {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, images.get(0));
                } else {
                    mBinding.messageOriginalIcon.setVisibility(View.GONE);
                }
                voteMoreUser(messageEntity);
                break;
            case "comment_vote":
                mBinding.messageCommand.setText("赞了你了你的评论");
                mBinding.messageContent.setVisibility(View.GONE);
                mBinding.messageOriginalTitle.setText(messageEntity.getArticle().getTitle());
                targetUrl = messageEntity.getArticle().getThumb();
                if (TextUtils.isEmpty(targetUrl)) {
                    mBinding.messageOriginalIcon.setVisibility(View.GONE);
                } else {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, targetUrl);
                }
                voteMoreUser(messageEntity);
                break;
            case "answer_comment_vote":
                mBinding.messageCommand.setText("赞了你的评论");
                mBinding.messageContent.setVisibility(View.GONE);
                mBinding.messageOriginalTitle.setText(messageEntity.getComment().getContent());
                mBinding.messageOriginalIcon.setVisibility(View.GONE);
                voteMoreUser(messageEntity);
                break;
            case "community_article_comment_vote":
            case "video_comment_vote":
                mBinding.messageCommand.setText("赞了你的评论");
                mBinding.messageContent.setVisibility(View.GONE);
                if (messageEntity.getComment().getContent() != null) {
                    mBinding.messageOriginalTitle.setText(messageEntity.getComment().getContent().replace(imageCommentStr, ""));
                }
                images = messageEntity.getComment().getImages();
                if (images.size() > 0) {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, images.get(0));
                } else {
                    mBinding.messageOriginalIcon.setVisibility(View.GONE);
                }
                voteMoreUser(messageEntity);
                break;
            case "invited":
                mBinding.messageCommand.setText("邀请你回答");
                mBinding.messageContent.setVisibility(View.GONE);
                mBinding.messageOriginalTitle.setText(messageEntity.getQuestion().getTitle());
                videos = messageEntity.getQuestion().getVideos();
                if (videos.size() > 0) {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, videos.get(0).getPoster());
                } else {
                    images = messageEntity.getQuestion().getImages();
                    if (images.size() > 0) {
                        mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                        ImageUtils.display(mBinding.messageOriginalIcon, images.get(0));
                    } else {
                        mBinding.messageOriginalIcon.setVisibility(View.GONE);
                    }
                }
                voteMoreUser(messageEntity);
                break;
            case "system_invited":
                mBinding.messageCommand.setText("有新问题等你回答");
                mBinding.messageContent.setVisibility(View.GONE);
                mBinding.messageOriginalTitle.setText(messageEntity.getQuestion().getTitle());
                videos = messageEntity.getQuestion().getVideos();
                if (videos.size() > 0) {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, videos.get(0).getPoster());
                } else {
                    images = messageEntity.getQuestion().getImages();
                    if (images.size() > 0) {
                        mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                        ImageUtils.display(mBinding.messageOriginalIcon, images.get(0));
                    } else {
                        mBinding.messageOriginalIcon.setVisibility(View.GONE);
                    }
                }
                voteMoreUser(messageEntity);
                break;
            case "community_article_vote":
                mBinding.messageCommand.setText("赞同你的帖子");
                mBinding.messageContent.setVisibility(View.GONE);
                mBinding.messageOriginalTitle.setText(messageEntity.getArticle().getTitle());
                videos = messageEntity.getArticle().getVideos();
                if (videos.size() > 0) {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, videos.get(0).getPoster());
                } else {
                    images = messageEntity.getArticle().getImages();
                    if (images.size() > 0) {
                        mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                        ImageUtils.display(mBinding.messageOriginalIcon, images.get(0));
                    } else {
                        mBinding.messageOriginalIcon.setVisibility(View.GONE);
                    }
                }
                voteMoreUser(messageEntity);
                break;
            case "community_article_comment":
                mBinding.messageCommand.setText("评论了你的帖子");
                mBinding.messageContent.setVisibility(View.VISIBLE);
                content = messageEntity.getComment().getContent();
                mBinding.messageOriginalTitle.setText(messageEntity.getArticle().getTitle());
                videos = messageEntity.getArticle().getVideos();
                if (videos.size() > 0) {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, videos.get(0).getPoster());
                } else {
                    images = messageEntity.getArticle().getImages();
                    if (images.size() > 0) {
                        mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                        ImageUtils.display(mBinding.messageOriginalIcon, images.get(0));
                    } else {
                        mBinding.messageOriginalIcon.setVisibility(View.GONE);
                    }
                }
                voteMoreUser(messageEntity);
                break;
            case "community_article_comment_reply_vote":
            case "video_comment_reply_vote":
                mBinding.messageCommand.setText("赞了你的回复");
                mBinding.messageContent.setVisibility(View.GONE);
                mBinding.messageOriginalTitle.setText(messageEntity.getComment().getContent());
                mBinding.messageOriginalIcon.setVisibility(View.GONE);
                voteMoreUser(messageEntity);
                break;
            case "game_comment_reply_vote":
                mBinding.messageCommand.setText("赞了你的回复");
                mBinding.messageContent.setVisibility(View.GONE);
                mBinding.messageOriginalTitle.setText(messageEntity.getReply().getContent());
                mBinding.messageOriginalIcon.setVisibility(View.GONE);
                voteMoreUser(messageEntity);
                break;
            case "reply_community_article_comment":
            case "video_comment_reply":
                if ("reply".equals(messageEntity.getDialogue().getTo().getType())) {
                    mBinding.messageCommand.setText("回复了你");
                    mBinding.messageOriginalIcon.setVisibility(View.GONE);
                } else {
                    mBinding.messageCommand.setText("回复了你的评论");
                    images = messageEntity.getDialogue().getTo().getImages();
                    if (images.size() > 0) {
                        mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                        ImageUtils.display(mBinding.messageOriginalIcon, images.get(0));
                    } else {
                        mBinding.messageOriginalIcon.setVisibility(View.GONE);
                    }
                }
                mBinding.messageContent.setVisibility(View.VISIBLE);
                content = messageEntity.getDialogue().getFrom().getContent();
                if (messageEntity.getDialogue().getTo().getContent() != null) {
                    mBinding.messageOriginalTitle.setText(messageEntity.getDialogue().getTo().getContent().replace(imageCommentStr, ""));
                }
                voteMoreUser(messageEntity);
                break;
            case "update-answer":
                mBinding.messageCommand.setText("更新了回答");
                mBinding.messageContent.setVisibility(View.VISIBLE);
                content = messageEntity.getAnswer().getContent();
                mBinding.messageOriginalTitle.setText(messageEntity.getQuestion().getTitle());
                images = messageEntity.getAnswer().getImages();
                if (images.size() > 0) {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, images.get(0));
                } else {
                    mBinding.messageOriginalIcon.setVisibility(View.GONE);
                }
                voteMoreUser(messageEntity);
                break;
            case "game_comment_vote":
                mBinding.messageCommand.setText("赞了你的评价");
                mBinding.messageContent.setVisibility(View.GONE);
                mBinding.messageOriginalTitle.setText(messageEntity.getComment().getContent());
                targetUrl = messageEntity.getGame().getDefaultIcon();
                if (TextUtils.isEmpty(targetUrl)) {
                    mBinding.messageOriginalIcon.setVisibility(View.GONE);
                } else {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, targetUrl);
                }
                voteMoreUser(messageEntity);
                break;
            case "game_comment_reply":
                mBinding.messageCommand.setText("回复了你的评价");
                mBinding.messageContent.setVisibility(View.VISIBLE);
                content = messageEntity.getReply().getContent();
                String parentId = messageEntity.getReply().getParent().getId();
                // parentContent为空代表是回复评价中的回复，否则是回复游戏评价
                if (!TextUtils.isEmpty(parentId)) {
                    mBinding.messageOriginalTitle.setText(messageEntity.getReply().getParent().getContent());
                } else {
                    String comment = messageEntity.getReply().getComment();
                    if (comment != null) {
                        comment = comment.replace("\n", "");
                        Pattern p = Pattern.compile(LABEL_REGEX);
                        Matcher m = p.matcher(comment);
                        if (m.find()) {
                            SpannableStringBuilder contents = TextHelper.getCommentLabelSpannableStringBuilder(comment, com.gh.gamecenter.common.R.color.text_tertiary);
                            ExtensionsKt.setTextWithHighlightedTextWrappedInsideWrapper(
                                    mBinding.messageOriginalTitle,
                                    contents,
                                    Constants.DEFAULT_TEXT_WRAPPER,
                                    com.gh.gamecenter.common.R.color.text_tertiary,
                                    new TextHelper.DirectToWebViewHighlightedTextClick(context, "消息中心-消息列表")
                            );
                        } else {
                            ExtensionsKt.setTextWithHighlightedTextWrappedInsideWrapper(
                                    mBinding.messageOriginalTitle,
                                    comment,
                                    Constants.DEFAULT_TEXT_WRAPPER,
                                    com.gh.gamecenter.common.R.color.text_tertiary,
                                    new TextHelper.DirectToWebViewHighlightedTextClick(context, "消息中心-消息列表")
                            );
                        }
                    }
                }
                targetUrl = messageEntity.getGame().getDefaultIcon();
                if (TextUtils.isEmpty(targetUrl)) {
                    mBinding.messageOriginalIcon.setVisibility(View.GONE);
                } else {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, targetUrl);
                }
                voteMoreUser(messageEntity);
                break;
            case "video_comment":
                mBinding.messageCommand.setText("评论了你的帖子");
                mBinding.messageContent.setVisibility(View.VISIBLE);
                content = messageEntity.getComment().getContent();
                mBinding.messageOriginalTitle.setText(messageEntity.getVideo().getTitle());
                targetUrl = messageEntity.getVideo().getPoster();
                if (TextUtils.isEmpty(targetUrl)) {
                    mBinding.messageOriginalIcon.setVisibility(View.GONE);
                } else {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, targetUrl);
                }
                voteMoreUser(messageEntity);
                break;
            case "video_vote":
                mBinding.messageCommand.setText("赞同了你的视频");
                mBinding.messageContent.setVisibility(View.GONE);
                mBinding.messageOriginalTitle.setText(messageEntity.getVideo().getTitle());
                targetUrl = messageEntity.getVideo().getPoster();
                if (TextUtils.isEmpty(targetUrl)) {
                    mBinding.messageOriginalIcon.setVisibility(View.GONE);
                } else {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, targetUrl);
                }
                voteMoreUser(messageEntity);
                break;
            case "reply_activity_comment":
                mBinding.messageCommand.setText("回复了你");
                mBinding.messageContent.setVisibility(View.VISIBLE);
                content = messageEntity.getDialogue().getFrom().getContent();
                mBinding.messageOriginalTitle.setText(messageEntity.getActivity().getTitle());
                targetUrl = messageEntity.getActivity().getImageUrl();
                if (TextUtils.isEmpty(targetUrl)) {
                    mBinding.messageOriginalIcon.setVisibility(View.GONE);
                } else {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, targetUrl);
                }
                voteMoreUser(messageEntity);
                break;
            case "activity_comment_vote":
                mBinding.messageCommand.setText("赞了你的评论");
                mBinding.messageContent.setVisibility(View.GONE);
                mBinding.messageOriginalTitle.setText(messageEntity.getActivity().getTitle());
                targetUrl = messageEntity.getActivity().getImageUrl();
                if (TextUtils.isEmpty(targetUrl)) {
                    mBinding.messageOriginalIcon.setVisibility(View.GONE);
                } else {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, targetUrl);
                }
                voteMoreUser(messageEntity);
                break;
            case "activity_comment_reply_vote":
                mBinding.messageCommand.setText("赞了你的回复");
                mBinding.messageContent.setVisibility(View.GONE);
                mBinding.messageOriginalTitle.setText(messageEntity.getActivity().getTitle());
                targetUrl = messageEntity.getActivity().getImageUrl();
                if (TextUtils.isEmpty(targetUrl)) {
                    mBinding.messageOriginalIcon.setVisibility(View.GONE);
                } else {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, targetUrl);
                }
                voteMoreUser(messageEntity);
                break;
            case "game_list_vote":
                mBinding.messageCommand.setText("赞了你的游戏单");
                mBinding.messageContent.setVisibility(View.GONE);
                mBinding.messageOriginalTitle.setText(messageEntity.getGameList().getTitle());
                targetUrl = messageEntity.getGameList().getCover();
                if (TextUtils.isEmpty(targetUrl)) {
                    mBinding.messageOriginalIcon.setVisibility(View.GONE);
                } else {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, targetUrl);
                }
                voteMoreUser(messageEntity);
                break;
            case "game_list_comment":
                mBinding.messageCommand.setText("评价了你的游戏单");
                mBinding.messageContent.setVisibility(View.VISIBLE);
                content = messageEntity.getComment().getContent();
                mBinding.messageOriginalTitle.setText(messageEntity.getGameList().getTitle());
                targetUrl = messageEntity.getGameList().getCover();
                if (TextUtils.isEmpty(targetUrl)) {
                    mBinding.messageOriginalIcon.setVisibility(View.GONE);
                } else {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, targetUrl);
                }
                voteMoreUser(messageEntity);
                break;
            case "game_list_comment_vote":
                mBinding.messageCommand.setText("赞了你的评评价");
                mBinding.messageContent.setVisibility(View.GONE);
                mBinding.messageOriginalTitle.setText(messageEntity.getComment().getContent());
                targetUrl = messageEntity.getGameList().getCover();
                if (TextUtils.isEmpty(targetUrl)) {
                    mBinding.messageOriginalIcon.setVisibility(View.GONE);
                } else {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, targetUrl);
                }
                voteMoreUser(messageEntity);
                break;
            case "game_list_comment_reply":
                mBinding.messageCommand.setText("回复了你的游戏单评价");
                mBinding.messageContent.setVisibility(View.VISIBLE);
                content = messageEntity.getComment().getContent();
                mBinding.messageOriginalTitle.setText(messageEntity.getComment().getParent().getContent());
                targetUrl = messageEntity.getGameList().getCover();
                if (TextUtils.isEmpty(targetUrl)) {
                    mBinding.messageOriginalIcon.setVisibility(View.GONE);
                } else {
                    mBinding.messageOriginalIcon.setVisibility(View.VISIBLE);
                    ImageUtils.display(mBinding.messageOriginalIcon, targetUrl);
                }
                voteMoreUser(messageEntity);
                break;
        }

        TextHelper.highlightTextThatIsWrappedInsideWrapperByDefault(
                mBinding.messageContent,
                content,
                Constants.DEFAULT_TEXT_WRAPPER,
                new TextHelper.DirectToWebViewHighlightedTextClick(mBinding.messageContent.getContext(), "消息中心-消息列表")
        );

        mBinding.messageOriginalTitle.post(() -> {
            ViewGroup.LayoutParams params = mBinding.messageOriginal.getLayoutParams();
            if (mBinding.messageOriginalTitle.getLineCount() > 1 || mBinding.messageOriginalIcon.getVisibility() == View.VISIBLE) {
                params.height = DisplayUtils.dip2px(52F);
            } else {
                params.height = DisplayUtils.dip2px(36F);
            }
            mBinding.messageOriginal.setLayoutParams(params);
        });

        IDirectProvider directUtils = TheRouter.get(IDirectProvider.class);

        mBinding.messageUserMore.setOnClickListener(v -> {
            MessageEntity.Fold fold = messageEntity.getFold();
            if (fold != null && !ClickUtils.isFastDoubleClick(mBinding.messageUserMore.getId(), 1000)) {
                getFoldList(context, messageEntity.getFold().getResourceId());
            }
        });
        mBinding.messageUserIcon.setOnClickListener(v -> {
            MtaHelper.onEvent("消息中心", mOuterInfo, "点击头像");
            NewLogUtils.logMessageInformUserClick("message_inform_user_icon_click");
            if (directUtils != null) {
                directUtils.directToHomeActivity(itemView.getContext(), messageEntity.getUserEntity().getId(), entrance, "消息中心-赞同及邀请");
            }
        });
        mBinding.messageUserName.setOnClickListener(v -> {
            MtaHelper.onEvent("消息中心", mOuterInfo, "点击名字");
            NewLogUtils.logMessageInformUserClick("message_inform_user_name_click");
            if (directUtils != null) {
                directUtils.directToHomeActivity(itemView.getContext(), messageEntity.getUserEntity().getId(), entrance, "消息中心-邀同及赞请");
            }
        });
    }

    private void voteMoreUser(MessageEntity messageEntity) {
        MessageEntity.Fold fold = messageEntity.getFold();
        if (fold != null && fold.getNumber() > 1) {
            mBinding.messageUserMore.setVisibility(View.VISIBLE);
            mBinding.messageUserMore.setText((" 等" + fold.getNumber() + "人"));
        } else {
            mBinding.messageUserMore.setVisibility(View.GONE);
        }
    }

    private void getFoldList(Context context, String resourceId) {
        RetrofitManager.Companion
                .getInstance()
                .getApi()
                .getMessageFoldList(UserManager.getInstance().getUserId(), resourceId)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Response<List<MessageFold>>() {
                    @Override
                    public void onResponse(@Nullable List<MessageFold> response) {

                        List<UserEntity> list = new ArrayList<>();
                        for (MessageFold messageFold : response) {
                            UserEntity user = messageFold.getUser();
                            user.setTime(messageFold.getTime());
                            list.add(user);
                        }

                        if (context instanceof FragmentActivity) {
                            AskFollowMoreDialog dialog = AskFollowMoreDialog.getInstance("赞同了你", "消息中心-折叠", (ArrayList<UserEntity>) list);
                            dialog.show(((FragmentActivity) context).getSupportFragmentManager(), "more");
                        }
                    }

                    @Override
                    public void onFailure(@Nullable HttpException e) {
                        Utils.toast(context, R.string.request_failure_normal_hint);
                    }
                });
    }

    public static void messageItemClickSkip(
            View view,
            MessageEntity entity,
            String entrance,
            String outerInfo,
            String path,
            String sessionGameId,
            String sessionGameName,
            String sessionGameType,
            String sessionMessageType
    ) {
        if (view == null || entity == null) return;
        Context context = view.getContext();
        CommunityEntity community;

        if (view.getId() == R.id.message_original) {
            MtaHelper.onEvent("消息中心", outerInfo, "点击链接");
        } else if (view.getId() == R.id.message_item) {
            MtaHelper.onEvent("消息中心", outerInfo, "点击卡片");
        }

        Intent intent;
        String messageType;

        INewCommentDetailProvider newCommentDetailProvider = TheRouter.get(INewCommentDetailProvider.class);
        IGameCollectionDetailProvider gameCollectionDetailProvider = TheRouter.get(IGameCollectionDetailProvider.class);

        switch (entity.getType()) {
            case "comment_vote":
                NewLogUtils.logMessageInformClick(
                        "",
                        entity.getArticle().getId(),
                        "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        "赞同"
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        "赞同"
                );
                if (view.getId() == R.id.message_original) {
                    TheRouter.build(RouteConsts.activity.newsDetailActivity)
                            .withString(EntranceConsts.KEY_NEWSID, entity.getArticle().getId())
                            .withString(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
                            .navigation();
                } else if (view.getId() == R.id.message_item) {
                    IMessageDetailProvider messageDetailProvider = TheRouter.get(IMessageDetailProvider.class);
                    if (messageDetailProvider != null) {
                        context.startActivity(messageDetailProvider.getIntentById(context,
                                entity.getArticle().getId(), -1, false, BaseActivity.mergeEntranceAndPath(entrance, path)));
                    }
                }
                break;
            case "reply":
                NewLogUtils.logMessageInformClick(
                        "",
                        entity.getArticle().getId(),
                        "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        "普通消息"
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        "普通消息"
                );
                if (view.getId() == R.id.message_original) {
                    TheRouter.build(RouteConsts.activity.newsDetailActivity)
                            .withString(EntranceConsts.KEY_NEWSID, entity.getArticle().getId())
                            .withString(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
                            .navigation();
                } else if (view.getId() == R.id.message_item) {
                    ICommentDetailProvider commentDetailProvider = TheRouter.get(ICommentDetailProvider.class);
                    if (commentDetailProvider != null) {
                        context.startActivity(commentDetailProvider.getIntent(context, entity.getDialogue().getFrom().getId(), entity.getArticle()));
                    }
                }
                break;
            case "system_invited":
            case "invited":
                NewLogUtils.logMessageInformClick(
                        entity.getQuestion().getId(),
                        "", "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        "邀请"
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        "邀请"
                );
                if (view.getId() == R.id.message_original || view.getId() == R.id.message_item) {
                    MessageEntity.Question question = entity.getQuestion();
                    TheRouter.build(RouteConsts.activity.questionDetailActivity)
                            .withString(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
                            .withString(EntranceConsts.KEY_QUESTIONS_ID, question.getId())
                            .withString(EntranceConsts.KEY_PATH, path)
                            .navigation();

                    Questions questions = new Questions();
                    questions.setId(question.getId());
                    questions.setTitle(question.getTitle());
                }
                break;
            case "answer":
            case "answer_vote":
                if ("answer".equals(entity.getType())) {
                    messageType = "普通消息";
                } else {
                    messageType = "赞同";
                }
                NewLogUtils.logMessageInformClick(
                        entity.getQuestion().getId(),
                        "", "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        messageType
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        messageType
                );
                TheRouter.build(RouteConsts.activity.questionDetailActivity)
                        .withString(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
                        .withString(EntranceConsts.KEY_QUESTIONS_ID, entity.getQuestion().getId())
                        .withString(EntranceConsts.KEY_TOP_COMMENT_ID, entity.getAnswer().getId())
                        .withBoolean(EntranceConsts.KEY_SCROLL_TO_COMMENT_AREA, true)
                        .withString(EntranceConsts.KEY_PATH, path)
                        .navigation();
                break;
            case "update-answer":
            case "follow_question":
                NewLogUtils.logMessageInformClick(
                        entity.getQuestion().getId(),
                        "", "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        "普通消息"
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        "普通消息"
                );
                if (view.getId() == R.id.message_original) {
                    MessageEntity.Question question = entity.getQuestion();
                    TheRouter.build(RouteConsts.activity.questionDetailActivity)
                            .withString(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
                            .withString(EntranceConsts.KEY_QUESTIONS_ID, question.getId())
                            .withString(EntranceConsts.KEY_ANSWER_ID, entity.getAnswer().getId())
                            .withBoolean(EntranceConsts.KEY_SCROLL_TO_COMMENT_AREA, true)
                            .withString(EntranceConsts.KEY_PATH, path)
                            .navigation();
                } else if (view.getId() == R.id.message_item) {
                    ISimpleAnswerDetailProvider simpleAnswerDetailProvider = TheRouter.get(ISimpleAnswerDetailProvider.class);
                    if (simpleAnswerDetailProvider != null) {
                        context.startActivity(simpleAnswerDetailProvider.getIntent(context, entity.getAnswer().getId(), entrance, path));
                    }
                }
                break;
            case "reply_answer_comment":
                NewLogUtils.logMessageInformClick(
                        entity.getQuestion().getId(),
                        "", "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        "普通消息"
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        "普通消息"
                );
                if (newCommentDetailProvider != null) {
                    context.startActivity(newCommentDetailProvider.getAnswerCommentIntent(
                            context,
                            entity.getAnswer().getId(),
                            entity.getQuestion().getId(),
                            entity.getDialogue().getFrom().getId(),
                            entrance,
                            path
                    ));
                }
                break;
            case "answer_comment_vote":
            case "answer_comment":
                if ("answer_comment".equals(entity.getType())) {
                    messageType = "普通消息";
                } else {
                    messageType = "赞同";
                }
                NewLogUtils.logMessageInformClick(
                        entity.getQuestion().getId(),
                        "", "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        messageType
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        messageType
                );
                if (newCommentDetailProvider != null) {
                    context.startActivity(newCommentDetailProvider.getAnswerCommentIntent(
                            context,
                            entity.getAnswer().getId(),
                            entity.getQuestion().getId(),
                            entity.getComment().getId(),
                            entrance,
                            path
                    ));
                }
                break;
            case "community_article_comment_vote":
            case "community_article_comment":
                if ("community_article_comment".equals(entity.getType())) {
                    messageType = "普通消息";
                } else {
                    messageType = "赞同";
                }
                NewLogUtils.logMessageInformClick(
                        entity.getArticle().getId(),
                        "", "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        messageType
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        messageType
                );
                community = new CommunityEntity(entity.getArticle().getCommunityId(), "");
                TheRouter.build(RouteConsts.activity.articleDetailActivity)
                        .withString(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
                        .withString(EntranceConsts.KEY_COMMUNITY_ARTICLE_ID, entity.getArticle().getId())
                        .withString(EntranceConsts.KEY_TOP_COMMENT_ID, entity.getComment().getId())
                        .withParcelable(EntranceConsts.KEY_COMMUNITY_DATA, community)
                        .withBoolean(EntranceConsts.KEY_SCROLL_TO_COMMENT_AREA, true)
                        .withString(EntranceConsts.KEY_PATH, path)
                        .navigation();
                break;
            case "community_article_comment_reply_vote":
                NewLogUtils.logMessageInformClick(
                        entity.getArticle().getId(),
                        "", "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        "赞同"
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        "赞同"
                );
                if (newCommentDetailProvider != null) {
                    context.startActivity(newCommentDetailProvider.getArticleCommentIntent(
                            context,
                            entity.getComment().getTopId(),
                            entity.getArticle().getCommunityId(),
                            entity.getArticle().getId(),
                            entity.getComment().getId(),
                            entrance,
                            path
                    ));
                }
                break;
            case "community_article_vote":
                NewLogUtils.logMessageInformClick(
                        entity.getArticle().getId(),
                        "", "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        "赞同"
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        "赞同"
                );
                community = new CommunityEntity(entity.getArticle().getCommunityId(), "");
                TheRouter.build(RouteConsts.activity.articleDetailActivity)
                        .withString(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
                        .withString(EntranceConsts.KEY_COMMUNITY_ARTICLE_ID, entity.getArticle().getId())
                        .withParcelable(EntranceConsts.KEY_COMMUNITY_DATA, community)
                        .withString(EntranceConsts.KEY_PATH, path)
                        .navigation();
                break;
            case "reply_community_article_comment":
                NewLogUtils.logMessageInformClick(
                        entity.getArticle().getId(),
                        "", "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        "普通消息"
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        "普通消息"
                );
                if (newCommentDetailProvider != null) {
                    context.startActivity(newCommentDetailProvider.getArticleCommentIntent(
                            context,
                            entity.getDialogue().getTo().getTopId(),
                            entity.getArticle().getCommunityId(),
                            entity.getArticle().getId(),
                            entity.getDialogue().getFrom().getId(),
                            entrance,
                            path
                    ));
                }
                break;
            case "game_comment_vote":
                NewLogUtils.logMessageInformClick(
                        "", "",
                        entity.getGame().getId(),
                        "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        "赞同"
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        "赞同"
                );
                IGameDetailProvider gameDetailProvider = TheRouter.get(IGameDetailProvider.class);
                if (gameDetailProvider != null) {
                    gameDetailProvider.startGameDetailActivity(
                            context,
                            entity.getGame().getId(),
                            BaseActivity.mergeEntranceAndPath(entrance, path),
                            true,
                            false,
                            false,
                            false,
                            null
                    );
                }
                break;
            case "game_comment_reply":
            case "game_comment_reply_vote":
                if ("game_comment_reply".equals(entity.getType())) {
                    messageType = "普通消息";
                } else {
                    messageType = "赞同";
                }
                NewLogUtils.logMessageInformClick(
                        "", "",
                        entity.getGame().getId(),
                        "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        messageType
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        messageType
                );
                ExposureSource exposureSource = new ExposureSource("消息中心", "");
                ArrayList<ExposureSource> exposureSourceList = new ArrayList<>();
                exposureSourceList.add(exposureSource);
                TheRouter.build(RouteConsts.activity.ratingReplyActivity)
                        .withString(EntranceConsts.KEY_GAMEID, entity.getGame().getId())
                        .withString(EntranceConsts.KEY_COMMENTID, entity.getReply().getCommentId())
                        .withString(EntranceConsts.KEY_TOP_COMMENT_ID, entity.getReply().getId())
                        .withString(EntranceConsts.KEY_EXPOSURE_SOURCE, GsonUtils.toJson(exposureSourceList))
                        .withString(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
                        .withString(EntranceConsts.KEY_PATH, path)
                        .navigation();
                break;
            case "video_vote":
                NewLogUtils.logMessageInformClick(
                        entity.getVideo().getId(),
                        "", "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        "赞同"
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        "赞同"
                );
                IDirectProvider directUtils = TheRouter.get(IDirectProvider.class);
                directUtils.directToVideoDetail(
                        context,
                        entity.getVideo().getId(),
                        entrance,
                        outerInfo,
                        ""
                );
                break;
            case "video_comment":
            case "video_comment_vote":
                if ("video_comment".equals(entity.getType())) {
                    messageType = "普通消息";
                } else {
                    messageType = "赞同";
                }
                NewLogUtils.logMessageInformClick(
                        entity.getVideo().getId(),
                        "", "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        messageType
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        messageType
                );
                TheRouter.build(RouteConsts.activity.forumVideoDetailActivity)
                        .withString(EntranceConsts.KEY_VIDEO_ID, entity.getVideo().getId())
                        .withString(EntranceConsts.KEY_TOP_COMMENT_ID, entity.getComment().getId())
                        .withInt(BaseFragment_TabLayout.PAGE_INDEX, 1)
                        .navigation();
                break;
            case "video_comment_reply":
                NewLogUtils.logMessageInformClick(
                        entity.getVideo().getId(),
                        "", "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        "普通消息"
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        "普通消息"
                );
                String commentId;
                if ("reply".equals(entity.getDialogue().getTo().getType())) {
                    commentId = entity.getDialogue().getTo().getTopId();
                } else {
                    commentId = entity.getDialogue().getTo().getId();
                }
                if (newCommentDetailProvider != null) {
                    context.startActivity(newCommentDetailProvider.getVideoCommentIntent(
                            context,
                            commentId,
                            entity.getVideo().getId(),
                            entity.getDialogue().getFrom().getId(),
                            entrance,
                            path
                    ));
                }
                break;
            case "video_comment_reply_vote":
                NewLogUtils.logMessageInformClick(
                        entity.getVideo().getId(),
                        "", "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        "赞同"
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        "赞同"
                );
                if (newCommentDetailProvider != null) {
                    context.startActivity(newCommentDetailProvider.getVideoCommentIntent(
                            context,
                            entity.getComment().getTopId(),
                            entity.getVideo().getId(),
                            entity.getComment().getId(),
                            entrance,
                            path
                    ));
                }
                break;

            case "reply_activity_comment":
            case "activity_comment_vote":
            case "activity_comment_reply_vote":
                if ("reply_activity_comment".equals(entity.getType())) {
                    messageType = "普通消息";
                } else {
                    messageType = "赞同";
                }
                NewLogUtils.logMessageInformClick(
                        entity.getVideo().getId(),
                        "", "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        messageType
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        messageType
                );
                IWebProvider webProvider = TheRouter.get(IWebProvider.class);
                if (webProvider != null) {
                    if (view.getId() == R.id.message_original) {
                        context.startActivity(webProvider.getIntent(context, entity.getActivity().getUrl(), true));
                    } else if (view.getId() == R.id.message_item) {
                        context.startActivity(webProvider.getIntent(context, entity.getActivity().getUrlComment(), true));
                    }
                }
                break;

            case "game_list_comment":
                NewLogUtils.logMessageInformClick(
                        "", "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        entity.getGameList().getId(),
                        "普通消息"
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        "普通消息"
                );
                if (gameCollectionDetailProvider != null) {
                    context.startActivity(gameCollectionDetailProvider.getSpecifiedCommentIntent(
                            context,
                            entity.getGameList().getId(),
                            entity.getComment().getId(),
                            "消息中心"
                    ));
                }
                break;
            case "game_list_comment_vote":
                NewLogUtils.logMessageInformClick(
                        "", "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        entity.getGameList().getId(),
                        "赞同"
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        "赞同"
                );
                if (gameCollectionDetailProvider != null && newCommentDetailProvider != null) {
                    if (TextUtils.isEmpty(entity.getComment().getTopId())) {
                        intent = gameCollectionDetailProvider.getSpecifiedCommentIntent(
                                context,
                                entity.getGameList().getId(),
                                entity.getComment().getId(),
                                "消息中心"
                        );
                    } else {
                        intent = newCommentDetailProvider.getGameCollectionCommentIntent(
                                context,
                                entity.getComment().getTopId(),
                                entity.getGameList().getId(),
                                entity.getComment().getId(),
                                entrance,
                                path
                        );
                    }
                    context.startActivity(intent);
                }
                break;
            case "game_list_comment_reply":
                NewLogUtils.logMessageInformClick(
                        "", "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        entity.getGameList().getId(),
                        "普通消息"
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        "普通消息"
                );
                if (newCommentDetailProvider != null) {
                    context.startActivity(newCommentDetailProvider.getGameCollectionCommentIntent(
                            context,
                            entity.getComment().getTopId(),
                            entity.getGameList().getId(),
                            entity.getComment().getId(),
                            entrance,
                            path
                    ));
                }

                break;
            case "game_list_vote":
                NewLogUtils.logMessageInformClick(
                        "", "", "",
                        sessionGameId, sessionGameName, sessionMessageType,
                        entity.getGameList().getId(),
                        "赞同"
                );
                SensorsBridge.trackMessageItemClick(
                        sessionGameId,
                        sessionGameName,
                        sessionGameType,
                        sessionMessageType,
                        "赞同"
                );
                if (gameCollectionDetailProvider != null) {
                    context.startActivity(gameCollectionDetailProvider.getIntent(
                            context,
                            entity.getGameList().getId(),
                            false,
                            "消息中心"
                    ));
                }
                break;
        }
    }
}