|
|
@ -24,6 +24,7 @@ import io.legado.app.ui.audio.AudioPlayActivity |
|
|
|
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.ReadBookActivity |
|
|
|
import io.legado.app.ui.book.read.ReadBookActivity |
|
|
|
import io.legado.app.ui.book.source.edit.BookSourceEditActivity |
|
|
|
import io.legado.app.ui.book.source.edit.BookSourceEditActivity |
|
|
|
|
|
|
|
import io.legado.app.ui.changecover.ChangeCoverDialog |
|
|
|
import io.legado.app.ui.changesource.ChangeSourceDialog |
|
|
|
import io.legado.app.ui.changesource.ChangeSourceDialog |
|
|
|
import io.legado.app.ui.chapterlist.ChapterListActivity |
|
|
|
import io.legado.app.ui.chapterlist.ChapterListActivity |
|
|
|
import io.legado.app.utils.getViewModel |
|
|
|
import io.legado.app.utils.getViewModel |
|
|
@ -40,7 +41,8 @@ class BookInfoActivity : |
|
|
|
VMBaseActivity<BookInfoViewModel>(R.layout.activity_book_info, theme = Theme.Dark), |
|
|
|
VMBaseActivity<BookInfoViewModel>(R.layout.activity_book_info, theme = Theme.Dark), |
|
|
|
GroupSelectDialog.CallBack, |
|
|
|
GroupSelectDialog.CallBack, |
|
|
|
ChapterListAdapter.CallBack, |
|
|
|
ChapterListAdapter.CallBack, |
|
|
|
ChangeSourceDialog.CallBack { |
|
|
|
ChangeSourceDialog.CallBack, |
|
|
|
|
|
|
|
ChangeCoverDialog.CallBack { |
|
|
|
|
|
|
|
|
|
|
|
private val requestCodeChapterList = 568 |
|
|
|
private val requestCodeChapterList = 568 |
|
|
|
private val requestCodeSourceEdit = 562 |
|
|
|
private val requestCodeSourceEdit = 562 |
|
|
@ -184,6 +186,9 @@ class BookInfoActivity : |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun initOnClick() { |
|
|
|
private fun initOnClick() { |
|
|
|
|
|
|
|
iv_cover.onClick { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
tv_read.onClick { |
|
|
|
tv_read.onClick { |
|
|
|
viewModel.bookData.value?.let { |
|
|
|
viewModel.bookData.value?.let { |
|
|
|
readBook(it) |
|
|
|
readBook(it) |
|
|
@ -276,6 +281,13 @@ class BookInfoActivity : |
|
|
|
viewModel.changeTo(book) |
|
|
|
viewModel.changeTo(book) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun coverChangeTo(coverUrl: String) { |
|
|
|
|
|
|
|
viewModel.bookData.value?.let { |
|
|
|
|
|
|
|
it.coverUrl = coverUrl |
|
|
|
|
|
|
|
viewModel.saveBook() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun openChapter(chapter: BookChapter) { |
|
|
|
override fun openChapter(chapter: BookChapter) { |
|
|
|
if (chapter.index != viewModel.durChapterIndex) { |
|
|
|
if (chapter.index != viewModel.durChapterIndex) { |
|
|
|
viewModel.bookData.value?.let { |
|
|
|
viewModel.bookData.value?.let { |
|
|
|