Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Dec 16, 2024
1 parent 78829e4 commit 29ddc3e
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions app/src/main/java/io/legado/app/ui/book/toc/ChapterListAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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) :
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 29ddc3e

Please sign in to comment.