Merge pull request #216 from TouchInstinct/fix/keyboard_behavior

Fix keyboard behavior detection after recreating activity with opened keyboard
This commit is contained in:
Grigorii 2021-09-08 13:28:02 +03:00 committed by GitHub
commit c991526f35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 6 deletions

View File

@ -59,7 +59,7 @@ abstract class MviKeyboardResizableFragment<NavArgs, State, Action, VM>(
override fun onPause() {
super.onPause()
notifyKeyboardHidden()
if (isKeyboardVisible) activity.hideSoftInput()
if (isHideKeyboardOnBackEnabled) activity.removeOnBackPressedListener(keyboardHideListener)
}
@ -87,10 +87,5 @@ abstract class MviKeyboardResizableFragment<NavArgs, State, Action, VM>(
}
}
private fun notifyKeyboardHidden() {
if (isKeyboardVisible) onKeyboardHide()
isKeyboardVisible = false
}
}
// CPD-ON