From c043ea72fd2698d27a7dcbc0beb7844c572e544c Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 12 May 2022 08:45:12 +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/src/main/java/io/legado/app/model/CacheBook.kt | 8 ++++---- .../java/io/legado/app/ui/book/toc/ChapterListFragment.kt | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/CacheBook.kt b/app/src/main/java/io/legado/app/model/CacheBook.kt index 92f61b1a5..79394d5c4 100644 --- a/app/src/main/java/io/legado/app/model/CacheBook.kt +++ b/app/src/main/java/io/legado/app/model/CacheBook.kt @@ -131,9 +131,9 @@ object CacheBook { class CacheBookModel(var bookSource: BookSource, var book: Book) { - private val waitDownloadSet = hashSetOf() - private val onDownloadSet = hashSetOf() - private val successDownloadSet = hashSetOf() + private val waitDownloadSet = linkedSetOf() + private val onDownloadSet = linkedSetOf() + private val successDownloadSet = linkedSetOf() private val errorDownloadMap = hashMapOf() val waitCount get() = waitDownloadSet.size @@ -174,7 +174,7 @@ object CacheBook { } onDownloadSet.remove(index) //重试3次 - if (errorDownloadMap[index] ?: 0 < 3) { + if ((errorDownloadMap[index] ?: 0) < 3) { waitDownloadSet.add(index) } else { AppLog.put( diff --git a/app/src/main/java/io/legado/app/ui/book/toc/ChapterListFragment.kt b/app/src/main/java/io/legado/app/ui/book/toc/ChapterListFragment.kt index 6206b38d9..a6e561347 100644 --- a/app/src/main/java/io/legado/app/ui/book/toc/ChapterListFragment.kt +++ b/app/src/main/java/io/legado/app/ui/book/toc/ChapterListFragment.kt @@ -136,13 +136,13 @@ class ChapterListFragment : VMBaseFragment(R.layout.fragment_chapt } } mLayoutManager.scrollToPositionWithOffset(scrollPos, 0) - adapter.upDisplayTitle(scrollPos) + adapter.upDisplayTitles(scrollPos) } } override fun clearDisplayTitle() { adapter.clearDisplayTitle() - adapter.upDisplayTitle(mLayoutManager.findFirstVisibleItemPosition()) + adapter.upDisplayTitles(mLayoutManager.findFirstVisibleItemPosition()) } override val scope: CoroutineScope