Horis 1 год назад
Родитель
Сommit
e1c9e24c76
1 измененных файлов с 19 добавлено и 16 удалено
  1. 19 16
      app/src/main/java/io/legado/app/ui/book/toc/ChapterListAdapter.kt

+ 19 - 16
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)