diff --git a/app/src/main/java/com/gh/common/util/CommentUtils.java b/app/src/main/java/com/gh/common/util/CommentUtils.java index d077dc59c6..b84bde8064 100644 --- a/app/src/main/java/com/gh/common/util/CommentUtils.java +++ b/app/src/main/java/com/gh/common/util/CommentUtils.java @@ -152,7 +152,7 @@ public class CommentUtils { } public static void showAnswerCommentOptions(final CommentEntity commentEntity, final Context context, - final OnCommentCallBackListener listener, final String id, boolean showConversation) { + final OnCommentCallBackListener listener, final String id, boolean showConversation, String answerId) { final Dialog dialog = new Dialog(context); @@ -170,7 +170,7 @@ public class CommentUtils { dialogType.add("复制"); dialogType.add("举报"); - if (commentEntity.getParent() != null && showConversation) { + if (commentEntity.getParentUser() != null && showConversation) { dialogType.add("查看对话"); } @@ -209,7 +209,7 @@ public class CommentUtils { break; case "查看对话": - context.startActivity(CommentDetailActivity.getAnswerCommentIntent(context, commentEntity.getId())); + context.startActivity(CommentDetailActivity.getAnswerCommentIntent(context, commentEntity.getId(), answerId)); break; } }); diff --git a/app/src/main/java/com/gh/gamecenter/CommentDetailActivity.java b/app/src/main/java/com/gh/gamecenter/CommentDetailActivity.java index 4712021d23..54ad5642aa 100644 --- a/app/src/main/java/com/gh/gamecenter/CommentDetailActivity.java +++ b/app/src/main/java/com/gh/gamecenter/CommentDetailActivity.java @@ -23,9 +23,10 @@ public class CommentDetailActivity extends NormalActivity { return getIntent(context, CommentDetailFragment.class, args); } - public static Intent getAnswerCommentIntent(Context context, String commentId) { + public static Intent getAnswerCommentIntent(Context context, String commentId, String answerId) { Bundle args = new Bundle(); args.putString(EntranceUtils.KEY_COMMENTID, commentId); + args.putString(EntranceUtils.KEY_ANSWER_ID, answerId); // return new IntentFactory.Builder(context) // .setActivity(CommentDetailActivity.class) // .setFragment(CommentDetailFragment.class).setArgs(args).build(); diff --git a/app/src/main/java/com/gh/gamecenter/ask/AnswerCommentAdapter.java b/app/src/main/java/com/gh/gamecenter/ask/AnswerCommentAdapter.java index 5017e0c07e..904c551b37 100644 --- a/app/src/main/java/com/gh/gamecenter/ask/AnswerCommentAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/ask/AnswerCommentAdapter.java @@ -2,6 +2,7 @@ package com.gh.gamecenter.ask; import android.content.Context; import android.support.v7.widget.RecyclerView; +import android.text.TextUtils; import android.view.View; import android.view.ViewGroup; @@ -73,17 +74,17 @@ public class AnswerCommentAdapter extends ListAdapter { holder.commentContentTv.setText(commentEntity.getContent()); - if (commentEntity.getParent() != null && commentEntity.getParent().getUser() != null) { + if (commentEntity.getParentUser() != null && !TextUtils.isEmpty(commentEntity.getParentUser().getName())) { holder.quoteContainer.setVisibility(View.VISIBLE); - holder.quoteAuthorTv.setText(commentEntity.getParent().getUser().getName()); - holder.quoteContentTv.setText("孙一峰,星際爭霸與星際爭霸2的職業選手,電競戰隊Xteam的經理,美少女团体星際老男孩成員之一,還在杭州經營水產生意。"); + holder.quoteAuthorTv.setText(commentEntity.getParentUser().getName()); + holder.quoteContentTv.setText(commentEntity.getParentUser().getComment()); } else { holder.quoteContainer.setVisibility(View.GONE); } holder.commentLikeIv.setOnClickListener(v -> CommentUtils.postVoteToAnswerComment(mContext, mAnswerId, commentEntity, holder.commentLikeCountTv, holder.commentLikeIv, null)); - holder.itemView.setOnClickListener(v -> CommentUtils.showAnswerCommentOptions(commentEntity, mContext, mOnCommentCallBackListener, null, !mIsShowingConversation)); + holder.itemView.setOnClickListener(v -> CommentUtils.showAnswerCommentOptions(commentEntity, mContext, mOnCommentCallBackListener, null, !mIsShowingConversation, mAnswerId)); } private void initFooterViewHolder(FooterViewHolder holder) { diff --git a/app/src/main/java/com/gh/gamecenter/ask/AnswerCommentFragment.java b/app/src/main/java/com/gh/gamecenter/ask/AnswerCommentFragment.java index ac9e6099c5..b2ff63d515 100644 --- a/app/src/main/java/com/gh/gamecenter/ask/AnswerCommentFragment.java +++ b/app/src/main/java/com/gh/gamecenter/ask/AnswerCommentFragment.java @@ -42,6 +42,9 @@ public class AnswerCommentFragment extends ListFragment