|
|
@ -217,14 +217,11 @@ class BookInfoActivity : |
|
|
|
} |
|
|
|
} |
|
|
|
tv_toc.onClick { |
|
|
|
tv_toc.onClick { |
|
|
|
if (!viewModel.inBookshelf) { |
|
|
|
if (!viewModel.inBookshelf) { |
|
|
|
toast(R.string.after_add_bookshelf) |
|
|
|
viewModel.saveBook { |
|
|
|
return@onClick |
|
|
|
openChapterList() |
|
|
|
} |
|
|
|
} |
|
|
|
viewModel.bookData.value?.let { |
|
|
|
} else { |
|
|
|
startActivityForResult<ChapterListActivity>( |
|
|
|
openChapterList() |
|
|
|
requestCodeChapterList, |
|
|
|
|
|
|
|
Pair("bookUrl", it.bookUrl) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
tv_group.onClick { |
|
|
|
tv_group.onClick { |
|
|
@ -232,6 +229,15 @@ class BookInfoActivity : |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun openChapterList() { |
|
|
|
|
|
|
|
viewModel.bookData.value?.let { |
|
|
|
|
|
|
|
startActivityForResult<ChapterListActivity>( |
|
|
|
|
|
|
|
requestCodeChapterList, |
|
|
|
|
|
|
|
Pair("bookUrl", it.bookUrl) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun readBook(book: Book) { |
|
|
|
private fun readBook(book: Book) { |
|
|
|
if (!viewModel.inBookshelf) { |
|
|
|
if (!viewModel.inBookshelf) { |
|
|
|
viewModel.saveBook { |
|
|
|
viewModel.saveBook { |
|
|
@ -306,6 +312,10 @@ class BookInfoActivity : |
|
|
|
readBook(it) |
|
|
|
readBook(it) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (!viewModel.inBookshelf) { |
|
|
|
|
|
|
|
viewModel.delBook {} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|