1
0
Fork 0

For #6625 Fix back navigation in search mode from browser

master
mcarare 2019-11-19 16:10:14 +02:00 committed by Emily Kager
parent bd475d54e5
commit ef3c3de8a1
2 changed files with 5 additions and 7 deletions

View File

@ -226,20 +226,15 @@ class SearchFragment : Fragment(), BackHandler {
override fun onPause() {
super.onPause()
toolbarView.view.clearFocus()
// clearing focus makes keyboard hidden after activity is resumed
awesomeBarView.isKeyboardDismissedProgrammatically = true
}
override fun onBackPressed(): Boolean {
return when {
qrFeature.onBackPressed() -> {
view?.searchScanButton?.isChecked = false
// set to true because keyboard is being dismissed when returning from qr scan
awesomeBarView.isKeyboardDismissedProgrammatically = true
toolbarView.view.requestFocus()
}
!awesomeBarView.isKeyboardDismissedProgrammatically -> true
else -> false
else -> awesomeBarView.isKeyboardDismissedProgrammatically
}
}

View File

@ -188,7 +188,10 @@ class AwesomeBarView(
view.hideKeyboard()
isKeyboardDismissedProgrammatically = true
}
RecyclerView.SCROLL_STATE_IDLE -> isKeyboardDismissedProgrammatically = false
RecyclerView.SCROLL_STATE_IDLE -> {
isKeyboardDismissedProgrammatically = false
view.requestFocus()
}
}
}
}