From 1dab4dfe3d8f638049f6fc1815938c4e362ea54e Mon Sep 17 00:00:00 2001 From: machiav3lli Date: Thu, 23 Dec 2021 01:41:26 +0100 Subject: [PATCH] Update: Fix search bar initial setup [new UI] --- .../kotlin/com/looker/droidify/widget/FocusSearchView.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/kotlin/com/looker/droidify/widget/FocusSearchView.kt b/src/main/kotlin/com/looker/droidify/widget/FocusSearchView.kt index 16feac76..59085079 100644 --- a/src/main/kotlin/com/looker/droidify/widget/FocusSearchView.kt +++ b/src/main/kotlin/com/looker/droidify/widget/FocusSearchView.kt @@ -4,6 +4,7 @@ import android.content.Context import android.util.AttributeSet import android.view.KeyEvent import androidx.appcompat.widget.SearchView +import com.looker.droidify.R class FocusSearchView : SearchView { constructor(context: Context) : super(context) @@ -16,6 +17,11 @@ class FocusSearchView : SearchView { var allowFocus = true + init { + maxWidth = Int.MAX_VALUE + queryHint = context.getString(R.string.search) + } + override fun dispatchKeyEventPreIme(event: KeyEvent): Boolean { // Always clear focus on back press return if (hasFocus() && event.keyCode == KeyEvent.KEYCODE_BACK) {