Hey guys, i need help. I released my new app one ...
# compose
a
Hey guys, i need help. I released my new app one week ago. A few days after release, i got multiple issues reporting the same problem. The "comma" is not clickable on the Keyboard on Samsung phones located in germany. I checked the KeyboardType, but i used KeyboardType.Decimal. I will attach a screenshot. System is set to English (Germany). Reproducable with most Samsung phones. Compose Version 1.2.0 Same behaviour with Compose 1.3.0-beta03 There are some known problems on Stackoverflow, but noone has a workaround for compose... https://stackoverflow.com/questions/65184373/comma-doesnt-work-on-samsung-android-keyboard https://stackoverflow.com/questions/72044124/show-comma-instead-of-dot-keyboard
h
have you tried using
KeyboardType.Number
?
a
Yep. Of course
h
what's the result of that? Is comma present and disabled?
a
The same result. Comma is presented and disabled and dot is enabled
My current workaround is to accept both, comma and dot, in the onValueChange and replace it with the System Default seperator.
Copy code
DecimalFormatSymbols.getInstance().decimalSeparator
h
Hmm, it sounds like a clear decision made by Samsung regarding German locale. Unfortunately I do not have a Samsung device at hand to test this right now but please report it in the compose tracker so it's not lost and gets taken another look.
a
It seems to be relevant in other countries too (e.w. Portugal). That could not be a "decision". The dot is not a valid decimal seperator in germany. If this is Samsungs decision, they made a mistake.
Strange that i am the only one, having these issue in compose. In the old xml world, there are a few workarounds.
h
what are the workarounds for xml views?
Ah ok, the workarounds are not xml world specific. They are simillarr to my workaround
But the StackOverflow entry is 12 years old.... I would not even dream that the problem still exists today
Samsung is one of the leading device company...
h
is this happening on samsung's default keyboard? have you tested it with gboard?
a
Strange. I tooked an old XML based Android App, added an EditText
android:inputType="numberDecimal"
. The gboard shows both, dot and comma, both activated but only the dot will be picked. Location: German (Germany). Even on my Pixel 5, only the dot will be picked
Is that the expected behaviour? Pixel 5, Android XML, EditText numberDecimal, Germany and no comma is accepted?
The last StackOverflow seems to address these issue. It seems to be an Android issue, not a Samsung issue
j
We faced the same problem on the Samsung default keyboard. As a workaround we applied the KeyboardType
Phone
for all Samsung devices, which is obviously not perfect
m
that's what I call a production bug, gezzz
o
It should be possible in the platform, but I guess Compose has to pass the locale somehow to the keyboard. See this issue
KeyboardType.Decimal
doesn’t change anything on Samsung (compared to
KeyboardType.Number
)