更新目录界面

添加目录界面的长按功能:全选、反选、选择已选章节之后章节、添加书签、下载
This commit is contained in:
HapeLee committed 2025-09-16 03:04:37 +08:00
1 parent 07c01e2b35
commit 3a8166b74d
20 files changed
+523 -205

No files matched your search

@@ -71,13 +71,12 @@ object CacheBook {
}
}
fun start(context: Context, book: Book, start: Int, end: Int) {
if (!book.isLocal) {
fun start(context: Context, book: Book, selectedIndices: List<Int>) {
if (!book.isLocal && selectedIndices.isNotEmpty()) {
context.startService<CacheBookService> {
action = IntentAction.start
putExtra("bookUrl", book.bookUrl)
putExtra("start", start)
putExtra("end", end)
putIntegerArrayListExtra("indices", ArrayList(selectedIndices))
}
}
}
@@ -184,6 +183,10 @@ object CacheBook {
postEvent(EventBus.UP_DOWNLOAD, book.bookUrl)
}
fun addDownload(index: Int) {
addDownload(index, index)
}
@Synchronized
private fun onSuccess(chapter: BookChapter) {
onDownloadSet.remove(chapter.index)