@ -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()) {
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 ->