|
|
@ -30,6 +30,7 @@ import io.legado.app.ui.book.changecover.ChangeCoverDialog |
|
|
|
import io.legado.app.ui.book.changesource.ChangeBookSourceDialog |
|
|
|
import io.legado.app.ui.book.changesource.ChangeBookSourceDialog |
|
|
|
import io.legado.app.ui.book.group.GroupSelectDialog |
|
|
|
import io.legado.app.ui.book.group.GroupSelectDialog |
|
|
|
import io.legado.app.ui.book.info.edit.BookInfoEditActivity |
|
|
|
import io.legado.app.ui.book.info.edit.BookInfoEditActivity |
|
|
|
|
|
|
|
import io.legado.app.ui.book.read.PhotoDialog |
|
|
|
import io.legado.app.ui.book.read.ReadBookActivity |
|
|
|
import io.legado.app.ui.book.read.ReadBookActivity |
|
|
|
import io.legado.app.ui.book.search.SearchActivity |
|
|
|
import io.legado.app.ui.book.search.SearchActivity |
|
|
|
import io.legado.app.ui.book.source.edit.BookSourceEditActivity |
|
|
|
import io.legado.app.ui.book.source.edit.BookSourceEditActivity |
|
|
@ -104,7 +105,7 @@ class BookInfoActivity : |
|
|
|
viewModel.bookData.observe(this) { showBook(it) } |
|
|
|
viewModel.bookData.observe(this) { showBook(it) } |
|
|
|
viewModel.chapterListData.observe(this) { upLoading(false, it) } |
|
|
|
viewModel.chapterListData.observe(this) { upLoading(false, it) } |
|
|
|
viewModel.initData(intent) |
|
|
|
viewModel.initData(intent) |
|
|
|
initOnClick() |
|
|
|
initViewEvent() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onCompatCreateOptionsMenu(menu: Menu): Boolean { |
|
|
|
override fun onCompatCreateOptionsMenu(menu: Menu): Boolean { |
|
|
@ -263,7 +264,7 @@ class BookInfoActivity : |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun initOnClick() = binding.run { |
|
|
|
private fun initViewEvent() = binding.run { |
|
|
|
ivCover.setOnClickListener { |
|
|
|
ivCover.setOnClickListener { |
|
|
|
viewModel.bookData.value?.let { |
|
|
|
viewModel.bookData.value?.let { |
|
|
|
showDialogFragment( |
|
|
|
showDialogFragment( |
|
|
@ -271,6 +272,12 @@ class BookInfoActivity : |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ivCover.setOnLongClickListener { |
|
|
|
|
|
|
|
viewModel.bookData.value?.getDisplayCover()?.let { path -> |
|
|
|
|
|
|
|
showDialogFragment(PhotoDialog(path)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
true |
|
|
|
|
|
|
|
} |
|
|
|
tvRead.setOnClickListener { |
|
|
|
tvRead.setOnClickListener { |
|
|
|
viewModel.bookData.value?.let { |
|
|
|
viewModel.bookData.value?.let { |
|
|
|
readBook(it) |
|
|
|
readBook(it) |
|
|
|