Android Keyboard Type - android

Is it possible to have this keyboard in android when user tap on an edit text?
This keyboard needs to come up first. I used different input type however I didnt get the one that I attached.
Can someone please advice?

Is it possible to force that specific type of keyboard? No. You can't even force the keyboard to exist. The user chooses a keyboard program, such as the default Android keyboard, Swype, SwiftKey, etc. You can specify an input type like URL, numeric, text, password, etc. The keyboard the user selected will then choose what keyboard to display by default, based on its own logic, the input type, and any user settings. There is no way to force anything to a specific type of keyboard, although most of them will see numeric and switch to a keypad or numeric style keyboard.

A way to do it could be assigning a pattern to the input, like <input type="text" pattern="\d*"/> However this will also force only numbers entered.
One way to avoid the pattern being enforced is to avoid validation, so your input can look like this <input type="text" pattern="\d*" novalidate="true" />

Related

How to show keyboard with numbers and symbols by default - ionic

How to show keyboard like this by default on android ionic5 app?
I've tried type="number" but it only allows to input numbers. On ios it shows full keyboard with this type.
By default, I mean to show it immediately after user clicks on the input
You need to use inputmode and not type as per the documentation.
Try this type of input, it works for me
<ion-input type="text"></ion-input>
No, you can't. In face, you can't even be sure the keyboard has a screen like that on Android. On Android, the keyboard is a separate app, and not all OEMs use the same one (and the user can also switch it out themselves). You can set the input type as a hint for what it should display- but it can ignore that hint. And the hints are very generic- text, email, number, password, things like that. There's no hint that says "symbols screen" and not every keyboard has a screen line that. And I don't know of any hint that commonly maps to that either.

How to avoid <input /> field from showing `next` option instead of `go` (On mobile keyboard)

Having an input field like:
<input type="text" />
Will automatically (on Android) change the Enter option on you keyboard to Next, and it will jump to the next field.
How to avoid this behaviour?
In my case I'm using an input field to add tags to (or Chips), which works fine on its own on mobile because the appropriate event is fired.
But when the Next button shows, it seems to simulate pressing tab on your keyboard, i.e. it goes to the next field. I need it to behave as submit instead.
(Also can't find any relevant specs on this keyboard displaying behaviour, it seems to be a free-formed android specific thing)
The correct way to fix this is to use the enterkeyhint attribute, for instance:
<input type="text" enterkeyhint="done"/>
One solution or workaround is to set the type to search:
<input type="search" />
It's a bit odd to have to press a magnifying glass to add a tag in my usecase, but it works. And any of the other property values don't seem to produce the same result as I want: https://www.w3schools.com/html/html_form_input_types.asp
Like submit will trigger submitting the form, not the field, afaik.
Changing the input type to search works fine but I found another alternative to solve it keeping original input type. Just adding the attribute tabindex="-1" in all form inputs.

Android Default to Numeric Keypad with Option for QWERTY

Is it possible to have Android's numeric keypad display for an EditText (the one that would show with inputType="number"), while still having an option for users to switch back to the normal QWERTY keyboard?
My input field will usually be a number, but there will be times when text is necessary so I'd like to make it very easy to enter numbers, and extremely simple to switch over to entering text.
Thanks!
Yes, you can programatically change the keyboard being used by using the setInputType() method. So for instance, you could add a button in your UI that changes the input type from just pure numbers to a full on QWERTY keyboard.
Try this. It should leave the button on the on-screen keyboard that lets you toggle between letters and numbers.
In xml, don't constrain the input--just leave it to the default of letters. (Not sure if this matters.)
mEditText.setRawInputType(InputType.TYPE_CLASS_NUMBER);

HTML5 inputs on the Android browser

iPhone's Mobile Safari seems to recognize most new HTML5 input types, in particular the ones detailed here, such that tapping in an input declared like so:
<input type="number" id="myInput" value=""/>
presents the iPhone's numeric keypad.
However, in the Android browser, the usual text keypad is shown when tapping the same input.
Is there a workaround for the Android browser or an alternative attribute that can be set or even a library I can include to have the android browser respect this setting?
if you specify on the input element the type as "number" it will automatically open with the numeric keypad
example
<input type="number" pattern="[0-9]*" name="amount_zip" value="loading.."></input>
the pattern attribute is for iPhone,
you can also get more info on inputs here
I just tried <input type="number"> with a Xoom (Honecomb, I think) and it does cause the numeric keypad to open, which is great, but the field only appears to allow positive integers. Hitting the '-' and '.' keys on the keypad have no effect. Adding relevant min / max attributes or setting a proper pattern don't seem to have any effect. In other words, if you want the keyboard to appear and your numeric field only needs to be zero or a positive integer, this will work. Otherwise (floats, negative numbers), you'll have to use text.
(I realize I'm not answering the question here, I would like to have left this as a comment for the previous answer, but can't figure out how)

How can you configure an EditText's soft keyboard to use numbers initially, but still allow text?

I want to let users input a postal code to my app. The common use case is the US zip code, which are composed solely of numbers, so I'd like to display the numeric keyboard initially in the soft input. However, not all postal codes are solely digits, so I still need users to be able to enter other characters.
I've been trying to do this with android:inputType, but by setting the "number" flag, it automatically blocks any input except for number-based stuff. Is there a way to just accept general text, but get the soft keyboard to initially display a more number-based keyboard?
Have you tried initially setting the inputType to "number" and then via a TextWatcher changing the input type of the TextView programatically?

Categories

Resources