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