I am trying to have the app scrolled all the way to the bottom so that when the user clicks the username EditText box and/or password, he/she will be able to see the Log In button.
Here's what I mean by using an example from the Facebook App.
And this is what my App is doing. Not what I want.
Obviously, I did some research before submitting a question.
I've tried using setSoftInputMode to SOFT_INPUT_ADJUST_PAN and along with other ADJUST options. I also tried to do it the xml but still no luck.
I also tried using scrollView.scrollTo method, and set to button.getBottom() so it will scroll to the end of the button. But again, it didn't work.
Does anyone have any idea of what I could be doing right?
Thanks.
Related
I would love to add this elegant verification code screen to my app but I'm completely lost in how to do it
should I implement each box as a TextInputEditText ?
how can I make the cursor move from one box to the next one while typing ?
ps : I'm using kotlin
I would make those boxes as a TextViews (not EditText) - you don't want to have a soft keyboard opened and the user will be only using buttons below in order to enter verification code.
When the user presses number below - show it in the next available TextView, when every TextView is filled with number - verify whole code. The same should work backspace button - clearing previous filled TextView.
You might want to make TextView to be highlight when it is going to be filled with the next number press, you can do this with a state-list background.
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.
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!
In Google Maps, when you click the search box the real search comes up. The search box is just an imageview illusion with an onclicklistener
similarly, if you press the search button on the mobile device, the search box comes up.
I need to implement similar behavior, when the user clicks an image that is over the map (in a relativelayout), the search box for that mapview comes up.
how would I call the mapview's search feature??? I was thinking of just simulating a search button press but I dont even know what this function's name is.
Thanks for the insight!
The function you are looking for is onSearchRequested(). Just make a call on your onClickListener. Complete guide to search implementation can be found here.
http://developer.android.com/guide/topics/search/index.html
Does anyone of you friendly coders know how to change the text on the return key of the android keyboard. I am catching the return event of an EditText element to start an action. So I would like to show the user, that he can start the action with that key. Some applications do that. E.g. they replace the key with a search symbol.
I am also wondering why apps always have an additional button aside the text field. Clearly, this takes away screen space. But it may be necessary for some purpose I am not aware off. The one problem I could imagine is task switching. After switching back, the user would have to call the keyboard before he could start the action. The other is a hardware keyboard, but anyone will assume that the return key will start the action.
R.G.
There are some ways to change the behaviour of the return button on your software keyboard. If you want to have the search Icon on your keyboard you have to add android:imeOptions="actionSearch" to your EditText View. There are some other actions that you can set for an overview over the available options have a look at the documentation of the TextView.
I would guess the reason that there are buttons next to many textfields to trigger the action is because users are used to it and would be a little bit at loss if the button is missing especially users with a hardware keyboard or if the software keyboard disappeared. One additional problem is that the return key is also used to create line breaks this means that if you want to have a multi line text field you cant use the return key to start an action.
If you want, you can hide the additional button beside the text area by adding the attribute
android:imeOptions="flagNoAccessoryAction" to your TextView or add it in code using
myTextView.setImeOptions(EditorInfo.IME_MASK_ACTION & EditorInfo.IME_FLAG_NO_ACCESSORY_ACTION);.
This is generally advised against, however, because of the user not being able to see what action will be performed when, say, the return key is pressed, or not being able to perform an action at all.
More info in this blog post: http://android-developers.blogspot.dk/2009/04/updating-applications-for-on-screen.html.