pull/90/head^2
kunfei 5 years ago
parent 1dc55667e3
commit 7c25389a4d
  1. 9
      app/src/main/java/io/legado/app/ui/book/search/HistoryKeyAdapter.kt

@ -1,6 +1,5 @@
package io.legado.app.ui.book.search package io.legado.app.ui.book.search
import android.content.Context
import io.legado.app.App import io.legado.app.App
import io.legado.app.R import io.legado.app.R
import io.legado.app.base.adapter.ItemViewHolder import io.legado.app.base.adapter.ItemViewHolder
@ -15,8 +14,10 @@ import org.jetbrains.anko.sdk27.listeners.onClick
import org.jetbrains.anko.sdk27.listeners.onLongClick import org.jetbrains.anko.sdk27.listeners.onLongClick
class HistoryKeyAdapter(context: Context, val callBack: CallBack) : class HistoryKeyAdapter(activity: SearchActivity, val callBack: CallBack) :
SimpleRecyclerAdapter<SearchKeyword>(context, R.layout.item_text) { SimpleRecyclerAdapter<SearchKeyword>(activity, R.layout.item_text) {
private val explosionField = ExplosionField.attach2Window(activity)
override fun convert(holder: ItemViewHolder, item: SearchKeyword, payloads: MutableList<Any>) { override fun convert(holder: ItemViewHolder, item: SearchKeyword, payloads: MutableList<Any>) {
with(holder.itemView) { with(holder.itemView) {
@ -26,7 +27,7 @@ class HistoryKeyAdapter(context: Context, val callBack: CallBack) :
} }
onLongClick { onLongClick {
it?.let { it?.let {
ExplosionField(context).explode(it, true) explosionField.explode(it, true)
} }
GlobalScope.launch(IO) { GlobalScope.launch(IO) {
App.db.searchKeywordDao().delete(item) App.db.searchKeywordDao().delete(item)

Loading…
Cancel
Save