This layout item
<EditText ... android:inputType="number|numberDecimal|numberSigned" ... />
must contain a numeric representation of the keyboard with decimal and signed notation. On most of my devices and emulators "." and "-" are on separate buttons, on Samsung Galaxy S5 / SM-G900P / Android 4.4.2 both. and '-' appear strange on the same button (as shown in the photo above on the LG device, also 4.4.2). On some devices, the snafu pop-up keyboard appears, as the sign and decimal place are placed on the same button.
However, for the first character of the field, if you double-click the (.-) button, a character will be entered instead of the decimal place. One click will enter decimal. The difficulty is to add text to explain this trick to your users.
Perhaps this project may have been made specifically to save button space. (ug, haven't we landed on an asteroid?)
Using this combination does not work, as you might hope:
android:inputType="number|numberSigned|numberDecimal" android:digits="0123456789.-"
Also, do not use android: numeric = "decimal" as it is reduced and does not solve the problem.
@Adrian's N / SW / E proposal would be a good addition, however, not an alternative, as the sign is still needed. Some users think in terms of a compass, some think - / +.
One solution is to create a custom input method editor (IME). Here is an example of a custom KeyboardView .
Specifically for entering latitude and longitude coordinates: I'm going to go to the custom IME / KeyboardView route and have special processing for writing lat / long, since there are also range values ββfor each field.
javajon
source share