pull/1013/head
gedoor 4 years ago
parent 6e69efb34e
commit 971dc3f2c5
  1. 2
      app/build.gradle
  2. 8
      app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt
  3. 2
      app/src/main/java/io/legado/app/ui/book/toc/TocViewModel.kt

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

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

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

Loading…
Cancel
Save