diff --git a/app/build.gradle b/app/build.gradle index 5c59be8c1..0b7ba28a4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -181,7 +181,7 @@ dependencies { implementation 'com.squareup.okhttp3:okhttp:4.9.1' //Glide - implementation 'com.github.bumptech.glide:glide:4.11.0' + implementation 'com.github.bumptech.glide:glide:4.12.0' //webServer implementation 'org.nanohttpd:nanohttpd:2.3.1' diff --git a/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt b/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt index 0867fd95e..06ae294b4 100644 --- a/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt +++ b/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt @@ -107,10 +107,12 @@ object BookChapterList { } val lh = LinkedHashSet(chapterList) val list = ArrayList(lh) - list.reverse() + if (!book.getReverseToc()) { + list.reverse() + } Debug.log(book.origin, "◇目录总数:${list.size}") - for ((index, item) in list.withIndex()) { - item.index = index + list.forEachIndexed { index, bookChapter -> + bookChapter.index = index } book.latestChapterTitle = list.last().title book.durChapterTitle = diff --git a/app/src/main/java/io/legado/app/ui/book/toc/TocViewModel.kt b/app/src/main/java/io/legado/app/ui/book/toc/TocViewModel.kt index cb0f8d708..a20df2249 100644 --- a/app/src/main/java/io/legado/app/ui/book/toc/TocViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/toc/TocViewModel.kt @@ -25,7 +25,7 @@ class TocViewModel(application: Application) : BaseViewModel(application) { fun reverseToc() { execute { bookData.value?.let { - it.setReverseToc(it.getReverseToc()) + it.setReverseToc(!it.getReverseToc()) val toc = appDb.bookChapterDao.getChapterList(bookUrl) val newToc = toc.reversed() newToc.forEachIndexed { index, bookChapter ->