8

I have an animation between two fragments. The second fragment will bring up a keyboard. As the keyboard will cover parts of the screen, I manually need to but a spacer view in there to adjust my view. Using android:windowSoftInputMode="adjustResize" will result in my transition-animation to be super laggy. Using adjustNothing on the other hand will make it smooth.

So is there any way to get the keyboard height without using adjustResize?

EDIT: My question is different to f.e. Is there any way in android to get the height of virtual keyboard of device as I can't add adjustResize

Community
  • 1
  • 1
Georg
  • 3,664
  • 3
  • 34
  • 75
  • 1
    Possible duplicate: http://stackoverflow.com/questions/16788959/is-there-any-way-in-android-to-get-the-height-of-virtual-keyboard-of-device – Asif Mujteba May 26 '15 at 12:07
  • You can use the solution from this answer, using a ViewTreeObserver: http://stackoverflow.com/a/19494006/4850160 It's more manual work, but it should do the trick. – memoizr May 26 '15 at 12:06
  • 2
    THis is right answer for this https://github.com/siebeprojects/samples-keyboardheight – NehaK Feb 17 '17 at 07:18
  • I set the activity to adjustNothing and use above library which is samples-keyboardheight. It works greatly! – Fantasy Fang Jan 10 '19 at 02:32

0 Answers0