How to capture the “virtual keyboard show/hide” event in Android?
2020 Update This is now possible: On Android 11, you can do view.setWindowInsetsAnimationCallback(object : WindowInsetsAnimation.Callback { override fun onEnd(animation: WindowInsetsAnimation) { super.onEnd(animation) val showingKeyboard = view.rootWindowInsets.isVisible(WindowInsets.Type.ime()) // now use the boolean for something } }) You can also listen to the animation of showing/hiding the keyboard and do a corresponding transition. I recommend reading Android … Read more