|
|
|
@ -1,6 +1,7 @@ |
|
|
|
|
package io.legado.app.ui.book.source.debug |
|
|
|
|
|
|
|
|
|
import android.content.Context |
|
|
|
|
import android.view.View |
|
|
|
|
import io.legado.app.R |
|
|
|
|
import io.legado.app.base.adapter.ItemViewHolder |
|
|
|
|
import io.legado.app.base.adapter.SimpleRecyclerAdapter |
|
|
|
@ -10,6 +11,18 @@ class BookSourceDebugAdapter(context: Context) : |
|
|
|
|
SimpleRecyclerAdapter<String>(context, R.layout.item_log) { |
|
|
|
|
override fun convert(holder: ItemViewHolder, item: String, payloads: MutableList<Any>) { |
|
|
|
|
holder.itemView.apply { |
|
|
|
|
if (text_view.getTag(R.id.tag1) == null) { |
|
|
|
|
val listener = object : View.OnAttachStateChangeListener { |
|
|
|
|
override fun onViewAttachedToWindow(v: View) { |
|
|
|
|
text_view.isCursorVisible = false |
|
|
|
|
text_view.isCursorVisible = true |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun onViewDetachedFromWindow(v: View) {} |
|
|
|
|
} |
|
|
|
|
text_view.addOnAttachStateChangeListener(listener) |
|
|
|
|
text_view.setTag(R.id.tag1, listener) |
|
|
|
|
} |
|
|
|
|
text_view.text = item |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|