From 2fbb4f1df79d9145a441e7b7ab8b08807c9d7b36 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 26 Sep 2019 10:24:53 +0800 Subject: [PATCH] up --- .../app/lib/theme/view/ATEAutoCompleteTextView.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATEAutoCompleteTextView.kt b/app/src/main/java/io/legado/app/lib/theme/view/ATEAutoCompleteTextView.kt index 6c0d8ec7a..ae7dec6e0 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATEAutoCompleteTextView.kt +++ b/app/src/main/java/io/legado/app/lib/theme/view/ATEAutoCompleteTextView.kt @@ -1,9 +1,10 @@ package io.legado.app.lib.theme.view +import android.annotation.SuppressLint import android.content.Context -import android.graphics.Rect import android.util.AttributeSet import android.view.LayoutInflater +import android.view.MotionEvent import android.view.View import android.view.ViewGroup import android.widget.ArrayAdapter @@ -32,12 +33,13 @@ class ATEAutoCompleteTextView : AppCompatAutoCompleteTextView { return true } - override fun onFocusChanged(focused: Boolean, direction: Int, previouslyFocusedRect: Rect?) { - super.onFocusChanged(focused, direction, previouslyFocusedRect) - if (focused) { + @SuppressLint("ClickableViewAccessibility") + override fun onTouchEvent(event: MotionEvent?): Boolean { + if (event?.action == MotionEvent.ACTION_DOWN) { showDropDown() } + return super.onTouchEvent(event) } fun setFilterValues(values: List?, delCallBack: ((value: String) -> Unit)? = null) {