From 29ddc3eee9538b9e9b4d65cec3ac452802e1db16 Mon Sep 17 00:00:00 2001 From: Horis <8674809+821938089@users.noreply.github.com> Date: Mon, 16 Dec 2024 14:14:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/book/toc/ChapterListAdapter.kt | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/toc/ChapterListAdapter.kt b/app/src/main/java/io/legado/app/ui/book/toc/ChapterListAdapter.kt index 26bf8c2b34a9..e5eebd6123c6 100644 --- a/app/src/main/java/io/legado/app/ui/book/toc/ChapterListAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/toc/ChapterListAdapter.kt @@ -20,7 +20,9 @@ import io.legado.app.utils.getCompatColor import io.legado.app.utils.gone import io.legado.app.utils.longToastOnUi import io.legado.app.utils.visible -import kotlinx.coroutines.* +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.ensureActive +import kotlinx.coroutines.launch import java.util.concurrent.ConcurrentHashMap class ChapterListAdapter(context: Context, val callback: Callback) : @@ -138,23 +140,24 @@ class ChapterListAdapter(context: Context, val callback: Callback) : //普通章节 保持不变 tvChapterItem.background = ThemeUtils.resolveDrawable(context, android.R.attr.selectableItemBackground) + } - //卷名不显示 - if (!item.tag.isNullOrEmpty()) { - //更新时间规则 - tvTag.text = item.tag - tvTag.visible() - } else { - tvTag.gone() - } - if (!item.wordCount.isNullOrEmpty()) { - //章节字数 - tvWordCount.text = item.wordCount - tvWordCount.visible() - } else { - tvWordCount.gone() - } + //卷名不显示 + if (!item.tag.isNullOrEmpty() && !item.isVolume) { + //更新时间规则 + tvTag.text = item.tag + tvTag.visible() + } else { + tvTag.gone() } + if (!item.wordCount.isNullOrEmpty() && !item.isVolume) { + //章节字数 + tvWordCount.text = item.wordCount + tvWordCount.visible() + } else { + tvWordCount.gone() + } + upHasCache(binding, isDur, cached) } else { tvChapterName.text = getDisplayTitle(item)