From 3c3654f2781a52b14fae92c78ecd090067fd1154 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 3 Feb 2020 18:54:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/info/BookInfoActivity.kt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt index fb689519c..0c1713246 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt @@ -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.read.ReadBookActivity 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.chapterlist.ChapterListActivity import io.legado.app.utils.getViewModel @@ -40,7 +41,8 @@ class BookInfoActivity : VMBaseActivity(R.layout.activity_book_info, theme = Theme.Dark), GroupSelectDialog.CallBack, ChapterListAdapter.CallBack, - ChangeSourceDialog.CallBack { + ChangeSourceDialog.CallBack, + ChangeCoverDialog.CallBack { private val requestCodeChapterList = 568 private val requestCodeSourceEdit = 562 @@ -184,6 +186,9 @@ class BookInfoActivity : } private fun initOnClick() { + iv_cover.onClick { + + } tv_read.onClick { viewModel.bookData.value?.let { readBook(it) @@ -276,6 +281,13 @@ class BookInfoActivity : viewModel.changeTo(book) } + override fun coverChangeTo(coverUrl: String) { + viewModel.bookData.value?.let { + it.coverUrl = coverUrl + viewModel.saveBook() + } + } + override fun openChapter(chapter: BookChapter) { if (chapter.index != viewModel.durChapterIndex) { viewModel.bookData.value?.let {