Fixes #1683: Only show/hide keyboard in search fragment

nightly-build-test
Sawyer Blatz 5 years ago committed by Colin Lee
parent 146492bd59
commit 28a852b17b

@ -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