Edittext selection menu and soft keyboard - android

In my activity, I have a multiline EditText that takes a big space on the screen. When I click on it, I enter the edit mode and the soft keyboard shows up. So far so good
Now I want to select the text. So I long press on it, and the selection handles appear. The problem is that when I select multiple lines, the whole layout of the activity will be pushed up to be able to see the selection above the keyboard. But it also pushes up the selection menu that allows to interact with the selection (like Copy, Search, etc.), so the selection is useless!
So best solution would be to make sure the menu stays visible, alternative solution would be to hide the keyboard when selection happens so that nothing is being pushed up.!
As you can see on the screenshot, the menu is almost gone because the selection is right on top of the keyboard, but without the keyboard it should appear just fine

Related

Android | How to hide BottomNavigation even if windowSoftInputMode is set to 'adjustResize'?

I have an activity with BottomNavigation. If the user needs to click on the submit button soft keyboard hides it. Then he again needs to press the back button to see the submit button. In this case, I used windowSoftInputMode='adjustResize' so that the screen gets resized automatically and the user can scroll up and click on the submit button.
But, I have BottomNavigation too, windowSoftInputMode='adjustResize' makes BottomNavigation float above the soft keyboard. Can anyone suggest a better solution? Any help will be appreciated. Thanks
Thats tricky issue... You have two options in here:
Keep 'adjustResize' and hide BottomNavigation view when keyboard pops up (e.g. simply setVisiblity?)
Change to e.g. 'adjustPan' (or any other) preventing keyboard resizing app and add bottom padding with height of keyboard for whole content container. BottomNavigation will stay hidden under keyboard, but padding will allow scrolling to Submit button
In both cases you need to detect open/close keyboard, in second case you will also need keyboard height measuring. IN HERE and HERE you have big SO topics about this case, check out answers and comments, and pick proper resolution for your purposes

How to make in app custom keyboard behave like a system keyboard?

I have an in app keyboard that tries to behave like a system keyboard. So far it pops up from the bottom using Bottom Sheet, which is great.
However, unlike a system keyboard, it does not push the entire layout up when you select an EditText that might otherwise get hidden. So far all the solutions I saw on StackOverFlow seem to be about Soft/System Keyboard not an in-app implementation like mine.
Here is my activity with 3 Edit Texts
This is what happens if I click on the last Edit Text. It gets covered by the keyboard in blue
This is how I want it to be. Everything getting pushed up.
How can I achieve this?

How to tap a button with one touch, when keyboard is open (instead of 2)

I have the keyboard open in my app, I want the user to be able to type, and then tap a colour selector widget I have made (which changes text colour). The problem is that it takes 2 taps, the first one closes the keyboard, the second one actually selects my colour picker. Is there a way to make this one tap? and also keep the keyboard open if possible, so they can change colour then go back to typing without focus issues.

EditText.setError() popup placement

I'm using the v16 API and having problems with where the popup is being placed when the onscreen keyboard is displayed.
The first problem is that if the EditText is at the bottom of the screen, when I touch the field to open it for editing the popup is displayed below the control and the immediately covered as the keyboard appears. It doesn't reposition itself above the EditText until a keypress triggers my validation code to fire again on the new value.
The second problem is that when I close the keyboard and the ScrollView containing the text scrolls back down from where it positioned itself to show the EditText above the keyboard the popup remains placed on the upper half of the screen instead of where the EditText is until I touch something else on the screen (triggering the ScrollView to do a redraw???).
Unfortunately that popup has various problems like this :(
Perhaps a simple solution in your case is to forcibly invalidate the UI when the keyboard has displayed and dismissed? Can't recall if the Popup will reposition if the EditText is invalidated, but worth trying as the alternative may be to re-implement.
Checkout my android-formidable-validation lib on github, it re-implements...though has its own problems - if you go down that path, why not give me a hand with some contributions ;)

Auto complete text remaining on screen

Does anyone know why the search text remains on the bottom of screen (as shown in image below). Steps to get there:
Choose to search for location
qwerty keyboard comes up
auto complete bar appears above qwerty
hit "Done" and the auto complete text remains on screen and relocates to bottom, but search is called
. This does not happen all the time.
With KeyEvent.ACTION_UP the search text "sticks" to screen when clicking "Done" ... goes directly to search
With KeyEvent.ACTION_MULTIPLE, "Done" closes the qwerty and user must click search button to begin search
If you want any word, I think the keyboard do that with predictive text. If only want a list of items ( only countries ) you should use a Spinner.

Categories

Resources