[fenix] Fixes https://github.com/mozilla-mobile/fenix/issues/1683: Only show/hide keyboard in search fragment

pull/600/head
Sawyer Blatz 5 years ago committed by Colin Lee
parent 72607b5a48
commit 2075ccf02e

@ -124,6 +124,7 @@ open class HomeActivity : AppCompatActivity() {
}
private fun showSoftwareKeyboardIfNecessary() {
if (navHost.navController.currentDestination?.id != R.id.searchFragment) { return }
(getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager).apply {
currentFocus?.also {
this.showSoftInput(it, 0)
@ -132,6 +133,7 @@ open class HomeActivity : AppCompatActivity() {
}
private fun hideSoftwareKeyboardIfNecessary() {
if (navHost.navController.currentDestination?.id != R.id.searchFragment) { return }
(getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager).apply {
currentFocus?.also {
this.hideSoftInputFromWindow(it.windowToken, 0)

Loading…
Cancel
Save