I have created a login page. If I insert some text in edit text (username, password) etc then a softkeyboard is visible. but it comes on my password field view. So upper half of password field is visible while lower half is not because of that softkeyboard. I want when the softkeyboard is visible the password field to move up a little, so that the entire edittext will be visible.
Thanks
add this line in your menifest.xml file
<activity android:name=".your_activity" android:windowSoftInputMode="adjustResize"></activity>
Your layout should shift up automatically when it has focus and the softkeyboard is displaying. I have a login form and I've done nothing special to get this behaviour.
One way you can solve this is by having a ScrollView as the root of your layout.
Related
In my app the first view of all my screens is an EditText, so every time I go to a screen the onscreen keypad pops up. how can I disable this popping up and enable it when manually clicked on the EditText????
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
This can be used in Fragment Class to move the Edit text up and Scroll till the end. The problem is that when I click on an EditText the keyboard pops up. I think I have to do it in java. Thank you!!!
You need to set windowSoftInputMode attribute to each activity in AndroidManifest.xml file.
<activity
android:name="YourActivityPath"
android:windowSoftInputMode="stateAlwaysHidden"/>
In the parent layout of you view add android:focusableInTouchMode="true" this will put the focus on the parent view and you won't need to do anything else to invoke the keyboard, it will automatically show when the edit text is clicked
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"
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">
Let's say we have a sample form in an Android Phonegap application (download source code).
The form has a very long list of input text fields.
Every time we focus input on a field, the keyboard is popup and the focused field is scrolled accordingly so that it sits on the top of the keyboard as below snapshot.
My question is: How can we make the form remain/not scroll its fields position - i.e. when we focus a field, the popup keyboard will overlap the bottom of the form no matter what fields it is overlapping?
Try this. Maybe working but not sure SEE HERE
<activity
android:windowSoftInputMode="adjustResize"
android:name=".youractivity" android:label="#string/app_name" >
I'm having a problem with my login form, it consists of username, password, and submit button. But when I touch my username EditText, the keyboard shows and it covers up my password and submit button.
Then I change my manifest to
android:windowSoftInputMode="adjustResize|stateHidden"
The whole form is now goes up, but my layout becomes resized and it doesn't look good. So, can I control how much my layout will go up, when I use adjustPan?
Try setting
android:layout_weight="1" for the all the
texts and buttons used..It may work.