I hide the keyboard. If I immediately make my view visible, there is a flash of the view above the keyboard, and then it goes down, on the place of the keyboard.
If I wait for the keyboard to hide/show and resize my layout (with onSizeChanged of my global layout), and then try to make my view visible, in many cases the system does not re-estimate my layouts correctly (maybe because I'm making a view visible in some weird part of the layout changes lifecycle?) So in many cases I just end up with no view shown. Sometimes there is weird space above the keyboard on the place of the view that should be hidden. If I do post(Runnable) and then call requestLayout() or make the view visible in the next frame, it is not good, because the flashing is there again, of course.
So basically I want to know the exact frame when the keyboard will resize my views, so that I can make them visible/invisible and prevent the flashing of different view structure/sizes. If I wait for onSizeChanged, it seems that it is too late.
I really hoped that the system will behave correctly and re-estimate my views sizes and position them in the right places, but if that is done in onSizeChanged, it doesn't work correctly.
I ended up doing the following: