mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 03:12:15 +00:00
Update: Fix search bar initial setup [new UI]
This commit is contained in:
parent
ea80e658cf
commit
1dab4dfe3d
@ -4,6 +4,7 @@ import android.content.Context
|
|||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.KeyEvent
|
import android.view.KeyEvent
|
||||||
import androidx.appcompat.widget.SearchView
|
import androidx.appcompat.widget.SearchView
|
||||||
|
import com.looker.droidify.R
|
||||||
|
|
||||||
class FocusSearchView : SearchView {
|
class FocusSearchView : SearchView {
|
||||||
constructor(context: Context) : super(context)
|
constructor(context: Context) : super(context)
|
||||||
@ -16,6 +17,11 @@ class FocusSearchView : SearchView {
|
|||||||
|
|
||||||
var allowFocus = true
|
var allowFocus = true
|
||||||
|
|
||||||
|
init {
|
||||||
|
maxWidth = Int.MAX_VALUE
|
||||||
|
queryHint = context.getString(R.string.search)
|
||||||
|
}
|
||||||
|
|
||||||
override fun dispatchKeyEventPreIme(event: KeyEvent): Boolean {
|
override fun dispatchKeyEventPreIme(event: KeyEvent): Boolean {
|
||||||
// Always clear focus on back press
|
// Always clear focus on back press
|
||||||
return if (hasFocus() && event.keyCode == KeyEvent.KEYCODE_BACK) {
|
return if (hasFocus() && event.keyCode == KeyEvent.KEYCODE_BACK) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user