From 982f5faf97feb2a3442cb7475cdcd51b01394868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=99=A8?= Date: Thu, 11 Apr 2024 15:47:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E3=80=90=E5=85=89=E7=8E=AF=E5=8A=A9?= =?UTF-8?q?=E6=89=8B=E3=80=91=E5=90=8C=E4=B8=80=E9=A1=B5=E9=9D=A2=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=9B=B8=E5=90=8C=E6=A0=B7=E5=BC=8F=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E5=9B=BE=E7=89=87=E5=A4=8D=E7=94=A8=20https://jira.sh?= =?UTF-8?q?anqu.cc/browse/GHZS-5197?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gh/gamecenter/entity/CommonCollectionEntity.kt | 8 +++++++- .../home/custom/adapter/CustomCommonCollectionAdapter.kt | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/gh/gamecenter/entity/CommonCollectionEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/CommonCollectionEntity.kt index 4782fc953f..5cd323b44b 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/CommonCollectionEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/CommonCollectionEntity.kt @@ -36,6 +36,8 @@ data class CommonCollectionEntity( @Parcelize data class CommonCollectionContentEntity( + @SerializedName("_id") + private val _id: String? = null, val title: String = "", val style: String = "", val image: String = "", @@ -45,4 +47,8 @@ data class CommonCollectionContentEntity( var addedContent1: String? = "", @SerializedName("added_content_2") var addedContent2: String? = "", -) : Parcelable \ No newline at end of file +) : Parcelable { + + val id: String + get() = _id ?: "" +} \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomCommonCollectionAdapter.kt b/app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomCommonCollectionAdapter.kt index 5b92b5312e..860db37cb9 100644 --- a/app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomCommonCollectionAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomCommonCollectionAdapter.kt @@ -32,7 +32,7 @@ class CustomCommonCollectionAdapter( } override fun getKey(t: CommonCollectionContentEntity): String { - return t.title + return t.id } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CustomCommonCollectionItemViewHolder {