Keyboard dont show decimal separator in ladscape orientation
Asked Answered
C

1

9

When trying to work with a comma (,) as the decimal separator and inputType="numberDecimal" (or "number"), I have problem in smartphone in landscape mode, the comma is not showing.

My layout:

enter image description here

When I open the keyboard:

enter image description here

My EditText layout.

<EditText
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
 android:digits="0123456789,"
 android:inputType="numberDecimal"
 android:text="5,2" />

And my default Locale is pt_BR, where the comma is the decimal separator.

In "tablets" is ok, because the keyboard is not full-screen.

enter image description here

If I remove android:inputType="numberDecimal", also is ok, but does not show the numeric keyboard.

Any suggestions?

EDIT #1

A partial solution I found was to add android:imeOptions="flagNoFullscreen".

EDIT #2

The comma is adopted by half the world. Why is it so hard on Android? :(

Cyclohexane answered 27/6, 2016 at 13:38 Comment(7)
Possible duplicate of #3822039Tense
It is definitely not the answer.Cyclohexane
The inputType settings aren't localized at all, so it's the same set of characters regardless of your locale. Have you tried this with a different keyboard app? The full-screen input mode is owned by the keyboard.Herat
Yes, tried with SwiftKey and Google, the two most used of the PlayStore. (Device Moto X 2 and Android 6.0)Cyclohexane
I did not know the fullscreen mode was designed by the keyboard, the two that I have used are very much alike in the top half.Cyclohexane
I tried too with ASUS Keyboard in Zenfone 5 and Android 4.4.2.Cyclohexane
This problem exists with decimal '.' as well, when typing in a number field it isn't displayed on landscape mode. It is actually entered it just isn't rendered in the edit control until you press done.Frustrate
A
0

android:inputType="numberDecimal" is for decimal inputs, it means all the digits from 0 to 9 including the decimal separator sign(.) can only be the input values. Comma is not the correct sign for the decimal separator. I think it may be a bug at your vendor not to produce all the correct localization values. You can try to use

<EditText
    android:inputType="number"
    android:digits="0123456789.,"/>
Aureomycin answered 27/6, 2016 at 14:23 Comment(2)
Thanks for the answer, but I had tried. It is the same problem with number :( ... strange thing is that the problem only occurs when open the keyboard in full screen.Cyclohexane
Specifying the digits doesn't make any difference. I have localized my edit control to use comma or decimal, neither are rendered.Frustrate

© 2022 - 2024 — McMap. All rights reserved.