From 5907da9b3076d31638edd86bc32387268aaf7215 Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 24 Sep 2019 16:00:33 +0800 Subject: [PATCH] up --- .../app/lib/theme/view/ATEAutoCompleteTextView.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 4e6d04b2f..b5d7337ff 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,8 +1,10 @@ package io.legado.app.lib.theme.view import android.content.Context +import android.graphics.Rect import android.os.Build import android.util.AttributeSet +import android.view.KeyEvent import androidx.appcompat.widget.AppCompatAutoCompleteTextView import io.legado.app.lib.theme.Selector import io.legado.app.lib.theme.ThemeStore @@ -19,4 +21,14 @@ class ATEAutoCompleteTextView(context: Context, attrs: AttributeSet) : .create() } } + + override fun enoughToFilter(): Boolean { + return true + } + + override fun onFocusChanged(focused: Boolean, direction: Int, previouslyFocusedRect: Rect?) { + super.onFocusChanged(focused, direction, previouslyFocusedRect) + + performFiltering(text, KeyEvent.KEYCODE_UNKNOWN) + } }