This commit is contained in:
Horis 2024-12-16 14:14:00 +08:00
parent 78829e4abe
commit 29ddc3eee9

View File

@ -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)