From cce289253da97dbf554a916da77dd48c0a5ec7cd Mon Sep 17 00:00:00 2001 From: chenjuntao Date: Fri, 13 Apr 2018 11:26:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=9E=E7=AD=94=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E4=BB=A5=E5=8F=8A=E8=AF=84=E8=AE=BA=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E4=B8=80=E4=BA=9B=E9=97=AE=E9=A2=98=20http://gitlab.g?= =?UTF-8?q?hzhushou.com/pm/issues-Inbox/issues/345?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/gh/common/util/CommentUtils.java | 2 +- .../com/gh/gamecenter/ask/AnswerDetailFragment.java | 6 +++--- .../java/com/gh/gamecenter/entity/UserDataEntity.kt | 5 +++++ app/src/main/res/layout/fragment_answer_detail.xml | 13 +++++++++++++ app/src/main/res/values/strings.xml | 1 + 5 files changed, 23 insertions(+), 4 deletions(-) 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 cbe5215240..9df01b3fc4 100644 --- a/app/src/main/java/com/gh/common/util/CommentUtils.java +++ b/app/src/main/java/com/gh/common/util/CommentUtils.java @@ -439,7 +439,7 @@ public class CommentUtils { if (entity.getVote() == 0) { holder.commentLikeCountTv.setVisibility(View.GONE); } else { // 检查是否已点赞 - if (userDataEntity != null && userDataEntity.isCommentVoted()) { + if (userDataEntity != null && (userDataEntity.isCommentVoted() || userDataEntity.isAnswerCommentVoted())) { holder.commentLikeCountTv.setTextColor(ContextCompat.getColor(mContext, R.color.theme)); holder.commentLikeIv.setImageResource(R.drawable.ic_like_select); } diff --git a/app/src/main/java/com/gh/gamecenter/ask/AnswerDetailFragment.java b/app/src/main/java/com/gh/gamecenter/ask/AnswerDetailFragment.java index 8644553b80..727ccd025a 100644 --- a/app/src/main/java/com/gh/gamecenter/ask/AnswerDetailFragment.java +++ b/app/src/main/java/com/gh/gamecenter/ask/AnswerDetailFragment.java @@ -349,7 +349,7 @@ public class AnswerDetailFragment extends NormalFragment { } else { // 跳转意见反馈 SuggestionActivity.startSuggestionActivity(getContext(), 1, "report", - "回答举报:(" + mAnswerId + ")"); + "回答举报(" + mAnswerId + "):"); } }); item2.setOnClickListener(v -> { @@ -481,9 +481,9 @@ public class AnswerDetailFragment extends NormalFragment { } if (mDetailEntity.getPublishTime() == mDetailEntity.getUpdateTime()) { - mTime.setText(String.format("发布于 %s\n著作权归作者所有@光环助手", NewsUtils.getFormattedTime(mDetailEntity.getPublishTime()))); + mTime.setText(String.format("发布于 %s", NewsUtils.getFormattedTime(mDetailEntity.getPublishTime()))); } else { - mTime.setText(String.format("编辑于 %s\n著作权归作者所有@光环助手", NewsUtils.getFormattedTime(mDetailEntity.getUpdateTime()))); + mTime.setText(String.format("编辑于 %s", NewsUtils.getFormattedTime(mDetailEntity.getUpdateTime()))); } mAnswerCommentCountTv.setText(String.format("%d 评论", mDetailEntity.getCommentCount())); diff --git a/app/src/main/java/com/gh/gamecenter/entity/UserDataEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/UserDataEntity.kt index 881ace9d6e..1f3215c13d 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/UserDataEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/UserDataEntity.kt @@ -28,6 +28,9 @@ class UserDataEntity : Parcelable { @SerializedName("is_answer_commented") var isAnswerCommented: Boolean = false + @SerializedName("is_answer_comment_voted") + var isAnswerCommentVoted: Boolean = false + @SerializedName("is_version_requested") var isVersionRequested: Boolean = false @@ -50,6 +53,7 @@ class UserDataEntity : Parcelable { dest.writeByte(if (this.isAnswerCommented) 1.toByte() else 0.toByte()) dest.writeTypedList(this.userDataLibaoList) dest.writeByte(if (this.isAnswerOwn) 1.toByte() else 0.toByte()) + dest.writeByte(if (this.isAnswerCommentVoted) 1.toByte() else 0.toByte()) } constructor() {} @@ -63,6 +67,7 @@ class UserDataEntity : Parcelable { this.isAnswerCommented = `in`.readByte().toInt() != 0 this.userDataLibaoList = `in`.createTypedArrayList(UserDataLibaoEntity.CREATOR) this.isAnswerOwn = `in`.readByte().toInt() != 0 + this.isAnswerCommentVoted = `in`.readByte().toInt() != 0 } companion object { diff --git a/app/src/main/res/layout/fragment_answer_detail.xml b/app/src/main/res/layout/fragment_answer_detail.xml index e531d93238..0ac98c532b 100644 --- a/app/src/main/res/layout/fragment_answer_detail.xml +++ b/app/src/main/res/layout/fragment_answer_detail.xml @@ -165,9 +165,22 @@ android:textColor="@color/title" android:textSize="14sp" android:gravity="right" + tools:text="发布于1分钟前" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toBottomOf="@id/answer_detail_Rd" /> + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ec49a427c3..84ff38aaf4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -547,5 +547,6 @@ 我来评论 已连续签到%1$d天]]> %1$d]]> + 著作权归作者所有©光环助手