pull/43/head
kunfei 5 years ago
parent ded1afe546
commit b5cd3fcfe9
  1. 4
      app/src/main/java/io/legado/app/ui/book/search/BookAdapter.kt
  2. 8
      app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt
  3. 2
      app/src/main/java/io/legado/app/ui/explore/ExploreShowActivity.kt

@ -14,11 +14,11 @@ class BookAdapter(context: Context, val callBack: CallBack) :
override fun convert(holder: ItemViewHolder, item: Book, payloads: MutableList<Any>) {
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)
}
}

@ -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<SearchViewModel>(R.layout.activity_book_se
}
}
override fun showBookInfo(url: String) {
startActivity<BookInfoActivity>(Pair("bookUrl", url))
override fun showBookInfo(book: Book) {
startActivity<BookInfoActivity>(
Pair("bookUrl", book.bookUrl),
Pair("key", IntentDataHelp.putData(book))
)
}
override fun searchHistory(key: String) {

@ -88,7 +88,7 @@ class ExploreShowActivity : VMBaseActivity<ExploreShowViewModel>(R.layout.activi
override fun showBookInfo(book: Book) {
startActivity<BookInfoActivity>(
Pair("searchBookUrl", book.bookUrl),
Pair("key", IntentDataHelp.putData(book, System.currentTimeMillis().toString()))
Pair("key", IntentDataHelp.putData(book))
)
}
}
Loading…
Cancel
Save