I am wondering if there is any way to set the position of the soft keyboard in android? I have a toolbar at the bottom which i want to remain visible when the keyboard appears. So is there any way of positioning the soft keyboard above the toolbar on screen? I have tried using different layouts but the keyboard always appears from the bottom of the screen hiding the toolbar.
Thanks,
Chris.
No there is no way to set the position of the soft keyboard, what you can do is put all of the content in a ScrollView except the toolbar and making the toolbar appear above the keyboard
Related
I have a requirement to show an editText on top of keyboard when the keyboard opens. But at the same time I have to hide the bottom tab navigation view on my fragment screen. It should be behind the keyboard.
I have tried multiple combinations for android:windowSoftInputMode but in some cases, either the EditTexts is not displayed or the entire screen is showing on top of keyboard.
Is there a way to keep the screen view as it is and open the keyboard with EditText on top of it.
I have FloatingActionButtons and FloatingActionMenus in CoordinatorLayouts, but I also have some EditTexts in there too, with the adjustPan window mode. But when I go to click the EditTexts, the floating buttons/menus come up along with the keyboard and somewhat block the visible area (such as the row containing the EditText). Can I somehow prevent the floating items from coming up with the keyboard?
There is a library which can listen to keyboard visibility, if the keyboard is visbile make the FAB to GONE or INVISIBLE.
https://github.com/yshrsmz/KeyboardVisibilityEvent
We are doing an app like Whatsapp, so we show an emoji panel or the soft keyboard. We are using adjustResize as we need to get the soft keyboard's height (in order to ensure that emoji panel has the same height as soft keyboard), everything works fine but, when changing from emoji panel to keyboard we see how the edittext goes to bottom and then goes up with the soft keyboard.
How could we do in order to fix the edittext while the soft keyboard is shown? I've thought about changing from adjustResize to adjustPan on the moment before the keyboard is shown, but then we are getting problems with measuring the keyboard's height (through the ViewTreeObserver).
Any idea about how could we solve that issue?
Thanks in advance
Put your layout with view into ScrollView and use adjustPan, in this way you can scroll content when the keyboard show's.
Or you can try:
android:windowSoftInputMode="adjustNothing"
i am playing with android soft keyboard example.but the problem i m getting predictive text area overlap the edit text box. I tried both
android:windowSoftInputMode="stateVisible|adjustResize"
and
android:windowSoftInputMode="stateVisible|adjustpan" but nothing
That's a problem with the keyboard. The keyboard implements a function onComputeInsets, which provides a visible inset and a content inset. If they make the visible inset bigger than the content inset, the difference will always overlap the app. There's no way for the app to fix this. You can see that if you switch to a different keyboard that likely won't happen.
I have a view that has a ScrollView as root layout that has a background set.
When the keyboard pops up, I want the ScrollView to shrink so that it stays above the keyboard, but I want the background image to stay the same. It currently shrinks with the view.
I know I need to use adjustResize to keep the ScrollView on top and I can switch to adjustNothing to get the ScrollView behind the keyboard, but that way I would have EditTexts behind the keyboard.
Any idea/help is welcome!
Basically, I want the adjustResize behavior with the background acting as in adjustNothing.
Here are some screenshots: