From b5cd3fcfe9161d0ae86102bf21eed7803e2b6825 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 26 Oct 2019 22:31:26 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/ui/book/search/BookAdapter.kt | 4 ++-- .../java/io/legado/app/ui/book/search/SearchActivity.kt | 8 ++++++-- .../java/io/legado/app/ui/explore/ExploreShowActivity.kt | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/search/BookAdapter.kt b/app/src/main/java/io/legado/app/ui/book/search/BookAdapter.kt index 3a08418e1..4165e5c23 100644 --- a/app/src/main/java/io/legado/app/ui/book/search/BookAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/search/BookAdapter.kt @@ -14,11 +14,11 @@ class BookAdapter(context: Context, val callBack: CallBack) : override fun convert(holder: ItemViewHolder, item: Book, payloads: MutableList) { with(holder.itemView) { text_view.text = item.name - onClick { callBack.showBookInfo(item.bookUrl) } + onClick { callBack.showBookInfo(item) } } } interface CallBack { - fun showBookInfo(url: String) + fun showBookInfo(book: Book) } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt b/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt index 7214418dd..4ca8d948b 100644 --- a/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt @@ -16,6 +16,7 @@ import io.legado.app.base.VMBaseActivity import io.legado.app.data.entities.Book import io.legado.app.data.entities.SearchKeyword import io.legado.app.data.entities.SearchShow +import io.legado.app.help.IntentDataHelp import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.primaryTextColor import io.legado.app.ui.book.info.BookInfoActivity @@ -223,8 +224,11 @@ class SearchActivity : VMBaseActivity(R.layout.activity_book_se } } - override fun showBookInfo(url: String) { - startActivity(Pair("bookUrl", url)) + override fun showBookInfo(book: Book) { + startActivity( + Pair("bookUrl", book.bookUrl), + Pair("key", IntentDataHelp.putData(book)) + ) } override fun searchHistory(key: String) { diff --git a/app/src/main/java/io/legado/app/ui/explore/ExploreShowActivity.kt b/app/src/main/java/io/legado/app/ui/explore/ExploreShowActivity.kt index 57f2c6fca..d2cef29e1 100644 --- a/app/src/main/java/io/legado/app/ui/explore/ExploreShowActivity.kt +++ b/app/src/main/java/io/legado/app/ui/explore/ExploreShowActivity.kt @@ -88,7 +88,7 @@ class ExploreShowActivity : VMBaseActivity(R.layout.activi override fun showBookInfo(book: Book) { startActivity( Pair("searchBookUrl", book.bookUrl), - Pair("key", IntentDataHelp.putData(book, System.currentTimeMillis().toString())) + Pair("key", IntentDataHelp.putData(book)) ) } } \ No newline at end of file