From 9912118d5b511a675df25f7e4a2ac49eb334bac3 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 31 Oct 2019 11:28:52 +0800 Subject: [PATCH] up --- .../ui/book/source/debug/BookSourceDebugAdapter.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugAdapter.kt b/app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugAdapter.kt index 2ec4e9518..7fd07fbda 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugAdapter.kt @@ -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(context, R.layout.item_log) { override fun convert(holder: ItemViewHolder, item: String, payloads: MutableList) { 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 } }