|
|
@ -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) |
|
|
|