From e0bcf947bf119463f6629ad4077612fee9d1acee Mon Sep 17 00:00:00 2001 From: lyr Date: Fri, 6 May 2022 20:53:09 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=85=89=E7=8E=AF=E5=8A=A9=E6=89=8BV5?= =?UTF-8?q?.9.0=E3=80=91=E6=96=B0=E7=A4=BE=E5=8C=BA7=E6=9C=9F-=E8=AE=BA?= =?UTF-8?q?=E5=9D=9B=E8=AF=A6=E6=83=85=E9=A1=B5=E4=BC=98=E5=8C=96=EF=BC=88?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=87=E7=AD=BE=E5=AD=97=E4=BD=93=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E5=AD=97=E6=AE=B5=EF=BC=89https://git.shanqu.cc/pm/ha?= =?UTF-8?q?lo-app-issues/-/issues/1789#note=5F146539?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gh/gamecenter/entity/ForumDetailEntity.kt | 6 +++++- .../gamecenter/forum/detail/ForumTopLinkAdapter.kt | 12 ++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/gh/gamecenter/entity/ForumDetailEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/ForumDetailEntity.kt index 464d929cf5..963d0d1731 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/ForumDetailEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/ForumDetailEntity.kt @@ -31,7 +31,11 @@ data class ForumDetailEntity( var style: Style = Style() ) - data class Style(var color: String = "") + data class Style( + var color: String = "", + @SerializedName("font_color") + var fontColor: String = "" + ) fun convertForumDetailEntityToForumEntity(): ForumEntity { val forumEntity = ForumEntity() diff --git a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumTopLinkAdapter.kt b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumTopLinkAdapter.kt index 0fc14972ba..0b87c08b4d 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumTopLinkAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumTopLinkAdapter.kt @@ -31,11 +31,15 @@ class ForumTopLinkAdapter( linkNameTv.text = linkEntity.title linkEntity.category?.run { tagView.visibility = View.VISIBLE - tagView.text = linkEntity.category!!.title - if (linkEntity.category!!.style.color.isNotBlank()) { + tagView.text = title + tagView.setTextColor( + if (style.fontColor.isNotBlank()) Color.parseColor(style.fontColor) + else Color.WHITE + ) + if (style.color.isNotBlank()) { tagView.background = DrawableView.getCornerGradientDrawable( - Color.parseColor(linkEntity.category!!.style.color), - Color.parseColor(linkEntity.category!!.style.color), + Color.parseColor(style.color), + Color.parseColor(style.color), 3F ) }