Keep view above keyboard - when keyboard appears - android

Currently, when I select an EditText in my application and the keyboard appears, the layout/view automatically adjusts to show the full EditText just above the keyboard, if it would have been below, otherwise.
Is there any way to set a different View to be just above the keyboard when it shows up? I have a button just below the EditText and I would like to have it just above the keyboard, if possible.

put that button and EditText into a layout and make that layout gravity top, or in Button's attributes add this line
android:layout_below="id of edittext"
Hope these help.

Related

ScrollView is not showing Editext after cliking on it and KeyBoard pops up

I have a problem and I don't find how to fix it.
I have an editText in my view, which is in a scrollView. When I click on it, keyboard shows up, and then I have to scroll to show my editext on my screen.
EDIT: My editText isn't hidden behind my keyboard, because my scrollview is adapted to my view when keyboard shows up. I've set
android:windowSoftInputMode="adjustResize"
in my manifest
I show you with screens of my App.
Thank you very much

Android soft keyboard on EditText do not work properly on second touch

My problem consistis in the second time the keyboard shows up on the SAME EditText.
I have many EditTexts inside a ListView, inside a Dialog, and the keyboard is set to ADJUST PAN. So far it is working fine, but when my list is bigger than the device screen and the EditText from last row is touched in first time the keyboard shows up and cover the layout correctly. But if I hide the keyboard from it native button to hide and click on the same EditText again the keyboard shows up and cover the layout and the Edittext, instead of covering and pushing to keep showing the EditText as the first time.
Any suggestions? Thank you!

How to put Margin between Edittext and softkeyboard in full screen

I am using viewpager with full screen theme.
but facing a problem that my softkeyboard hides the button when edittext in focus.
want to put some margin between EditText and Softkeyboard.
Tried all the things but nothing worked.
Please help me.
How to add margin between EditText and Soft Keyboard?
this is the questions link which i've asked.
In the activity entry in your AndroidManifest try putting:
android:windowSoftInputMode:adjustPan, this means when the keyboard comes up it will adjust the view behind it to move up so it is not obscured by the keyboard.
In the EditText you can also try adding a paddingBottom to adjust the gap between the keyboard and the bottom of the EditText.
In my case I had a custom background for the EditText, which was no longer looking OK. Because the parent view for me was ConstraintLayout I added another View element behind the EditText with:
app:layout_constraintEnd_toEndOf="#id/view_chat_history_send_text"
app:layout_constraintStart_toStartOf="#id/view_chat_history_send_text"
app:layout_constraintTop_toTopOf="#id/view_chat_history_send_text"
android:layout_marginBottom="#dimen/margin_normal"
Note: here view_chat_history_send_text is the EditText. And then I added a layout_marginBottom of the same margin as the paddingBottom of the EditText.
This means, when the EditText grows the background view grows as well, but it still maintains the gap between the keyboard and the EditText bottom.
I applied above methods which worked for me was
Set android:windowSoftInputMode on the Activity to "adjustPan"
than I added the padding to the edittext with gravity bottom
and it works like charm.

AdjustResize with a custom EditText not working correctly

I have an EditText using a background with a big height, when I click on my EditText, the screen shifts up to show the soft keyboard, but not the entire EditText stays visible. The bottom part of the Edit Text background disappears because the soft keyboard goes up in it.
I need that my screen shifts up a little more! How could I do that?
Tks,
I think its better to use a ScrollView.
Using this will shift the entire screen up.
Try it out once
Create a empty layout and put it at the bottom of the screen by property align parent bottom set to true.
Now set your edittext above it. Add property layout_above and pass the id of the layout.
Now in the manifest, add screensize to config changes attribute for that activity or in the application tag

How to avoid the on-screen keyboard from covering the EditText in android

whenever I click on the EditText, the screen readjusts and the edittext-view moves up. But this is not enough and the soft-keyboard still covers the view to not show what a user typing.
My layout is as follows:
A listview occupying 65% of screen height, followed by an editetxt view and a button
LISTVIEW
______________________________
EDITTEXT |BUTTON
______________________________
My activity has the following flag set android:windowSoftInputMode="stateAlwaysHidden|adjustPan"
adjustPan forces the soft keyboard to appear on top of your layout, blocking anything at the bottom. You're going to want to use adjust resize instead, which will move up your EditText and Button, and shrink the ListView. If, in landscape mode, the ListView is shrunk to the point of being unusable/pointless, consider using a fullscreen IME keyboard.
Read about something like that just recently. Is this what you are looking for?
http://www.vogella.de/blog/2010/10/25/android-windowsoftinputmode/

Categories

Resources