|
|
@ -217,9 +217,19 @@ 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() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
openChapterList() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
tv_group.onClick { |
|
|
|
|
|
|
|
GroupSelectDialog.show(supportFragmentManager) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun openChapterList() { |
|
|
|
viewModel.bookData.value?.let { |
|
|
|
viewModel.bookData.value?.let { |
|
|
|
startActivityForResult<ChapterListActivity>( |
|
|
|
startActivityForResult<ChapterListActivity>( |
|
|
|
requestCodeChapterList, |
|
|
|
requestCodeChapterList, |
|
|
@ -227,10 +237,6 @@ class BookInfoActivity : |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
tv_group.onClick { |
|
|
|
|
|
|
|
GroupSelectDialog.show(supportFragmentManager) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun readBook(book: Book) { |
|
|
|
private fun readBook(book: Book) { |
|
|
|
if (!viewModel.inBookshelf) { |
|
|
|
if (!viewModel.inBookshelf) { |
|
|
@ -306,6 +312,10 @@ class BookInfoActivity : |
|
|
|
readBook(it) |
|
|
|
readBook(it) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (!viewModel.inBookshelf) { |
|
|
|
|
|
|
|
viewModel.delBook {} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|