diff --git a/app/build.gradle b/app/build.gradle index f24e747..c59a879 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -57,7 +57,7 @@ android { dependencies { def lifecycle_version = "2.0.0" def room_version = "2.1.0-alpha03" - def nav_version = "1.0.0-alpha09" + def nav_version = "1.0.0-alpha11" def rx_bindings_version = "3.0.0-alpha2" implementation fileTree(dir: 'libs', include: ['*.jar']) diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/MerchantsFragment.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/MerchantsFragment.kt index b44ca17..1453506 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/MerchantsFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/MerchantsFragment.kt @@ -182,6 +182,9 @@ class MerchantsFragment : Fragment(), OnMapReadyCallback, SearchView.OnSuggestio } mSearchView?.setOnSuggestionListener(this) + + // Adjust SearchView width to avoid pushing other menu items out of the screen + mSearchView?.maxWidth = screenWidth * 7 / 10 } private fun updateSearchViewSuggestions(query: String) { diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/views/MyTextInputAutoCompleteTextView.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/views/MyTextInputAutoCompleteTextView.kt index d37b60d..de20277 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/views/MyTextInputAutoCompleteTextView.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/views/MyTextInputAutoCompleteTextView.kt @@ -1,15 +1,18 @@ package cy.agorise.bitsybitshareswallet.views import android.content.Context +import android.graphics.Rect import android.util.AttributeSet import com.google.android.material.textfield.TextInputLayout import android.view.inputmethod.InputConnection import android.view.inputmethod.EditorInfo import androidx.appcompat.widget.AppCompatAutoCompleteTextView +import cy.agorise.bitsybitshareswallet.utils.hideKeyboard /** * Custom AutoCompleteTextView to be used inside a TextInputLayout, so that they can share their hint * From https://stackoverflow.com/a/41864063/5428997 + * And also hides the keyboard when it loses focus. */ class MyTextInputAutoCompleteTextView : AppCompatAutoCompleteTextView { @@ -42,4 +45,9 @@ class MyTextInputAutoCompleteTextView : AppCompatAutoCompleteTextView { } return ic } + + override fun onFocusChanged(focused: Boolean, direction: Int, previouslyFocusedRect: Rect?) { + super.onFocusChanged(focused, direction, previouslyFocusedRect) + if (!focused) this.hideKeyboard() + } } \ No newline at end of file