pull/35/head
kunfei 5 years ago
parent 70d0c4c89f
commit 2fbb4f1df7
  1. 10
      app/src/main/java/io/legado/app/lib/theme/view/ATEAutoCompleteTextView.kt

@ -1,9 +1,10 @@
package io.legado.app.lib.theme.view package io.legado.app.lib.theme.view
import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.graphics.Rect
import android.util.AttributeSet import android.util.AttributeSet
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.ArrayAdapter import android.widget.ArrayAdapter
@ -32,12 +33,13 @@ class ATEAutoCompleteTextView : AppCompatAutoCompleteTextView {
return true 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() showDropDown()
} }
return super.onTouchEvent(event)
} }
fun setFilterValues(values: List<String>?, delCallBack: ((value: String) -> Unit)? = null) { fun setFilterValues(values: List<String>?, delCallBack: ((value: String) -> Unit)? = null) {

Loading…
Cancel
Save