pull/78/head
kunfei 5 years ago
parent cb7bad6c0f
commit c8d0109008
  1. 22
      app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt

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

Loading…
Cancel
Save