Android moving edit text automitcally - android

I have three EditText views named edittext_one ,edittext_two and edittext_three. I have put these views in a ScrollView. These EditTexts are clearly visible on the screen until my keyboard is not open. Now, I click on edittext_one, which is at the top, and my keyboard appears. Then, it hides my edittext_two and edittext_three. I want to go edittext_two just little bit up when I am typing in edittext_one so that user can see edittext_two. Same is happen with edittext_three. When user click on edittext_two, edittext_three slightly move up so user can see it.
I have lots of EditText in a scrollView, but I have just explained here three.
Please don't suggest me to use adjust pan and adjust resize because it never solves my problem.
Here is the link I used for iPhone
Sliding UITextFields around to avoid the keyboard but how do I do this in Android?

Try adding a click listener on edittext_one that does this:
int top = edittext_two.getTop();
scrollView.scrollTo(0,top);

Related

android softkeyboard to not cover any part of EditText

I am using a ScrollView as the parent in my layout file. In my manifest, for the activity, I have android:windowSoftInputMode="adjustPan". But the problem is that although the focus is not covered by the keyboard, part of the EditText is covered. This makes it difficult to move around in the multiline EditText.
As use case
Say I am four lines in, and I want to go back to line 2 to edit a misspelling. When I try to move the cursor, the EditText jumps up and down, making the user experience crappy. So how do I get the entire EditView to appear above the keyboard? And yes, there is room for that.
Try adding this line to your ScrollView: android:isScrollContainer="false"
See also Forcing adjustPan in activity containing ScrollView for reference.

Android animate edittext up on click

I have put ten edit text in scroll view when i click on edit text my keyboard appear. What i want when i click on edit text one its automatically show the edit text two which is right below the edit text one. I have used
android:windowSoftInputMode="adjustPan"
but none of them giving me the desired result and i think by doing this way i cannot acheive this.
Right Now I have to scroll manually or click on the next button. How to achieve this automatically as i have seen this functionality in many of the apps?
In your manifest, within the "activity" declaration for the Activity you need to resize, add
android:windowSoftInputMode="adjustResize"
If it doesn't work with your ScrollView you may need to implement a simple ListView.

How to trigger the horizontal orientation keyboard?

Context:
I have a small EditText field in my Activity, and it needs to be small because there is a lot of another View's on this Activity. But the content most of times are very long, and the user have a bad experience typing long texts into a small field.
Question:
How i can always show the "Horizontal Keyboard" when the user click on the EditText, even if the user are at Vertical Orientation(portrait) ?
Example:
Here is a screenshot of the "Horizontal Keyboard" that i'm talking about:
Important:
Setting the orientation to horizontal, is not really necessary. If this same keyboard shown on the image above can be triggered even if you are using vertical orientation, it would be useful too.
Sorry, I don't have 50 reputation points for commenting. But this link is for a question where OP is trying to disable the full screen keyboard. Perhaps if it's possible to disable, probably you are able to force enable it.
Disabling the fullscreen editing view for soft keyboard input in landscape?
EDIT:
So, searching a little more, I came to the conclusion that you can't force the keyboard to enter in fullscreen mode. Unless you make a keyboard app of your own that works only in fullscreen. But still would need the user to activate it on the settings menu.
Anyway, I found this solution by a user: force fullscreen on edittext in android, the answer suggests creating an Activity just for writing (an Activity with only an EditText as it's layout). And calling this Activity with the startActivityForResult method. Thus returning the text entered by the user and placing it on the respective EditText (or whatever widget you are going to use for the text).
Again, hope it helps.

Keyboard issue while focusing on bottom edit text in Android

I am working on an android Application where I am willing to get input from user. I created a layout for it which has a scroll view as a root view & Relative layout as it's child all the other layout are inside this Relative layout. But when edit text is at the bottom of screen & user click on it to bring keyboard it shows some blank box between edit text & keyboard & after this if user enters any word it doesn't get displayed in edit text. But if Edit text is above nearly more then half size of screen it works fine. You can get more clearly by looking at images below
Here is my code
Does anyone faced this kind of problem?? Please help!!!
The default IME mode set on the activity in the manifest (android:windowSoftInputMode="adjustPan") will pan the main layout so the text field is in the middle of the viewable area. While the majority of your content is in a scrollable region, it is simply moving the whole region and not scrolling the contents into view. If you use android:windowSoftInputMode="adjustNothing" it will prevent the layout panning, but will also effectively do nothing and just cover your original input.
MY recommendation would be to use adjustResize, this might fix it for you. If not, you have to look into doing some custom scroll-region focusing.

How to prevent the soft keyboard from displaying, or at least evict it once it does?

My app has an EditText that, when I click in it to enter text in the Emulator, brings up a soft keyboard. I don't want this confounded thing to begin with, but then, like the visiting loud-mouthed uncle in the plaid pants, doesn't want to go away, and it is blocking the button beneath it. How do I either (a) prorgrammatically prevent the soft keyboard from appearing or at least (b) evict it, albeit manually, when it pops up?
Provided that the user is not supposed to input text, but is able to click the EditText and then add text in some other way, you could change the EditText to a TextView and then apply the following three tags to it in the layout file:
style="#android:style/Widget.EditText"
android:editable="false"
android:focusableInTouchMode="false"
This will make it look like an EditText, but behave like a TextView.
Since you want the user to be able to write stuff in the EditText there are in my opinion two solutions:
Leave it be. To remove the keyboard, all you need is to hit the back button once and every Android user knows this. It's standard behaviour.
Wrap everything but the Button you say dissapears in a ScrollView. The ScrollView will then wrap its content to allow the Button to be shown in between the keyboard and the ScrollView.
Just set android:editable="false" for your EditText
The answer is to set the focus on an other View like a Button, TextView or similar:
// REQUEST FOCUS
viewName.setFocusableInTouchMode(true);
viewName.requestFocus();
I think what you really need is take a look at android:windowSoftInputMode attribute in Manifest.xml Look into this link.
You can specify the screen to pan/ resize to show the buttons that the input method might be blocking. Not allowing the keyboard to show will make the user unable to enter text at all!

Categories

Resources