1

I have a MVVM application I am working on I have added some animations to a screen and I need to fire them off when the user hides the keyboard. I have overridden the onbackpress however that is not called when a keyboard is hidden.

what I want to capture

edit: keyboard is set to adjust nothing as I want the animation to move the screen and resize things. So looking at size doesn't work. I was initially using https://github.com/yshrsmz/KeyboardVisibilityEvent but this doesn't work with adjust nothing.

  • Does this answer your question? [Soft keyboard open and close listener in an activity in Android](https://stackoverflow.com/questions/25216749/soft-keyboard-open-and-close-listener-in-an-activity-in-android) – Bö macht Blau Dec 19 '19 at 18:53
  • you can check [this](https://github.com/J-Jamet/keyboard-visibility-event-android) library for capturing keyboard events – Mohammed Alaa Dec 19 '19 at 18:55
  • @0X0nosugar I can't use the size to check. as I need the keyboard to adjust nothing. – android1029 Dec 19 '19 at 19:10
  • @MohammedAlaa I am going to assume the library is doing a size check and I can't use those, I was already using one. – android1029 Dec 19 '19 at 19:10
  • Then how about [overriding onKeyPreIme() for your EditText](https://stackoverflow.com/questions/3425932/detecting-when-user-has-dismissed-the-soft-keyboard)? – Bö macht Blau Dec 19 '19 at 19:50

0 Answers0