There is a CardView with an EditText and when the keyboard opens, it is placed right below the EditText. But as shown below, the keyboard is too close to the EditText and it is hard to press the "send" button because there is not enough space.
EditText:
EditText with focus:
Is there any way to show the keyboard after the end of the CardView?
I saw some similar questions here, but none of them provide a solution that I need. Some answers suggest to set a paddingBotton in EditText, but that is not what I want. I don't want space, I want to show the end of the CardView too.
Note that I don't want to resize the layout, so "adjustResize" is not the solution and I'm already using "adjustPan" in AndroidManifest.xml
<activity
...
android:windowSoftInputMode="adjustPan" />
Any thoughts?
If you are using scrollview. you can do one thing is to scroll your scrollview as your requirement
Please refer below code for example
ScrollView sv =(ScrollView)findViewById(R.id.scrl);
sv.scrollTo(0, sv.getBottom());
or
sv.fullScroll(View.FOCUS_DOWN);
this action you can perform on soft input of Enter key.
There is also one other solution you can hide the suggestion of keyboard by giving
android:inputType="textNoSuggestions"
Related
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
I have an EditText visible in a LinearLayout that I don't want to move when the soft keyboard is shown. The reason I don't want it to move is because I want to control the items above and adjust their sizes to make the EditText and the content it controls below to become visible.
Is it possible to prevent the screen moving at all once the soft keyboard is shown?
Note: I am using an activity with the toolbar hidden.
I have solved this - I have added the SetSoftInputMode to AdjustNothing to the OnCreate method. Doing this in the xml doesn't do anything, but in the code does.
In your AndroidManifest.xml file, go to your activity and add this.
<activity
...
android:windowSoftInputMode="adjustNothing"
/>
your views will remain in the same position
Anyone help to add DONE button on top of soft keyboard like above screenshot shows.
Because I need Enter and Done both button on my Edit Text.
So, please suggest me If anyone have Idea.
Thanks in Advance...
How about just adding a custom Button in the bottom of your UI?
You can observe layout size changes -> find a case when keyboard appears and disappears (Remember its different case from screen rotation, different screen proportion)
Based on keyboard hidden/shown event you can show/hide your custom UI.
I guess only problem is, you don't know what is keyboard view background. But its definitely better than writting your own keyboard, AFAIK you can't add views to keyboards.
You have to create a custom keyboard for that. For custom keyboard you can try here:
https://code.tutsplus.com/tutorials/create-a-custom-keyboard-on-android--cms-22615
https://developer.android.com/guide/topics/text/creating-input-method.html
https://inducesmile.com/android/how-to-create-an-android-custom-keyboard-application/
http://www.blackcj.com/blog/2016/03/30/building-a-custom-android-keyboard/
You would like to have an easy solution? Then integrate your "Done" button in your layout. Your layout should look like this (short version):
<LinearLayout orientation="vertical">
<ScrollView layout_weight="1"> <-- if needed, use FrameLayout else
place your Layout here
</ScrollView>
<YourDoneButton/>
</LinearLayout>
Your Button will stack on the top of the keyboard. I assume, that the user should be able to click of the "Done" button even if the keyboard is hidden. If not, you can hide it if your EditText is not focused.
I have some edittext on my layout, when I click on the edittext for filling it the softkeyboard appear and everything in fine, I can see the input and the softkeyboard but when I click on the edittexts at the bottom of the layout the softkeyboard appear and the edittext is not visible while I'm typing, I have to scroll down to see it. Is there any way to automatically scroll to the edittext so I can see when I'm typing and the softkeyboard at the same time?
You just need to add this to your activity tag in the manifest
android:windowSoftInputMode="adjustPan"
Have a look at this developers blog _ On-screen Input Methods.
Summing up I guess this line should help you:
android:windowSoftInputMode="stateVisible|adjustResize">
I done a form with 5 edittexts but when the keyboard is going to show the last two edittext I can't see.
Only way to switch to the next fields is to use the buttons on the keyboard.
There is any solution to add a scroll without use the buttons?
I tried with sdk 3, resize keyboard and other things like that.
Why not keep the entire layout in a scrollview. And add the attribute to the activity in manifest file
<activity android:windowSoftInputMode="stateVisible|adjustResize">
So when the keyboard is shown, the layout will be scrollable.
http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft
Have you tried adding the android:windowSoftInputMode tag to your activity in the manifest? From what you are describing I would think that either adjustResize or adjustPan should work.