I would like to alter the layout based on whether the virtual keyboard is shown or not. I've searched the API and various blogs but can't seem to find anything useful.
Is it possible?
Thanks!
I would like to alter the layout based on whether the virtual keyboard is shown or not. I've searched the API and various blogs but can't seem to find anything useful.
Is it possible?
Thanks!
This may not be the most effective solution. But this worked for me every time... I call this function where ever i need to listen to the softKeyboard.
Note: This approach will cause issues if the user uses a floating keyboard.
Sander ,I believe you are trying to show the view blocked by the soft keyboard. Try this http://android-developers.blogspot.com/2009/04/updating-applications-for-on-screen.html.
I have solve the problem on single line textview back coding.
You've got to handle configuration changes yourself.
http://developer.android.com/guide/topics/resources/runtime-changes.html#HandlingTheChange
Sample:
Then just change the visibility of some views, update a field, and change your layout file.
Note
This solution will not work for soft keyboards and
onConfigurationChanged
will not be called for soft keyboards.Not sure if anyone post this. Found this solution simple to use!. The SoftKeyboard class is on gist.github.com. But while keyboard popup/hide event callback we need a handler to properly do things on UI:
You can also check for first DecorView's child bottom padding. It will be set to non-zero value when keyboard is shown.