Numeric Keyboard on Surface Duo

Nathan Sokalski 4,116 Reputation points
2021-03-29T00:49:07.32+00:00

I have several EditText elements for which I want the user to only input integers. On the emulator (I admit I have only used one emulator, but I don't think that is the problem here), it displays a numeric keyboard (almost) as I want, but the Surface Duo (emulator & physical device) displays a keyboard with a number of extra characters. Here are screenshots of both:

Emulator:
82185-screenshot-1616977729.png

Surface Duo:
82128-screenshot-1616977547.png

Here are the relevant EditText properties I have set (in the style in styles.xml):

<item name="android:inputType">number|numberSigned</item>  
<item name="android:numeric">integer|signed</item>  
<item name="android:imeOptions">actionDone|flagNoExtractUi</item>  

Even though most of the keys do not do anything (it only lets the user type integers, which is what I want), the buttons for switching between & displaying the other keyboards (such as letters) makes it very ugly & unintuitive. Even though I would like to remove the space, comma & decimal from the keyboard used by the emulator, that is still intuitive for the user. Is there a way to make the Surface Duo display a keyboard that has only numeric keys? Thanks.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,295 questions
0 comments No comments
{count} votes