When i create an entry with keyboardtype numeric and run my app on samsung devices, the keyboard shows not a comma key (,). It only shows a dot key (.). But when i press the dot key, the TextChanged event is not fired.
We confirmed this behavior on a Samsung Galaxy Tab A (2016) and Samsung A5. When we install an other keyboard than the standard samsung keyboard (like SwiftKey) it works but this would be not an user-friendly solution. Numeric keyboard works correctly on devices from HTC, Sony, LG etc.
Xamarin.Forms.Entry entry = new Xamarin.Forms.Entry();
entry.Keyboard = Xamarin.Forms.Keyboard.Numeric;
Run this on an actual samsung device.
It would be optimal if the comma key is displayed and working. Alternatively, but should at least the dot key fire the TextChanged Event.
The keyboard shows not a comma key (,). It only shows a dot key (.). But when i press the dot key, the TextChanged ist not fired.
What language do you have set as your testing locale?
German
Upon review this is an issue with the custom Samsung keyboards themselves. They do not respect the current locale and thus result in the wrong keys being displayed. I don't think there is any way for us to fix this however I would be excited to hear if there is one.
The best advice I can give is don't use a numeric keyboard on samsung phones on locales that use a , separator :/
I think I found a solution for the comma issue on Samsung devices. I am using a custom Entry implementation in platform independent XAML content page. In the Android project I am then using a custom entry renderer that overrides the OnElementChanged method. My sample code snippet looks like this:
`protected override void OnElementChanged(ElementChangedEventArgs
{
base.OnElementChanged(e);
if (Control != null)
{
this.Control.KeyListener = DigitsKeyListener.GetInstance(true, true); // I know this is deprecated, but haven't had time to test the code without this line, I assume it will work without
this.Control.InputType = Android.Text.InputTypes.ClassNumber | Android.Text.InputTypes.NumberFlagDecimal;
}
}`
That does the trick for me and now I can enter commas also on Samsung devices.
Great work around, saved my day!
@harrykimpel thanks for the help, it works for me.
Great! The workaround works like charm
Please, anybody could please post the complete solution to Workaround this?
You have asked on xamarin forums and there is reply there. It didnt help?
The reply here is a bit different of others I tested and that didn't work. I just implemented it, but I don't have a Samsung Device to test it. My client will test it tomorrow and then give a feedback if it worked or not.
As i wrote on forum, reply here is outdated. Please follow forum reply and if you have any further question you can ask there
As i wrote on forum, reply here is outdated. Please follow forum reply and if you have any further question you can ask there
Can you post the link to the forum
This solution works.
Most helpful comment
I think I found a solution for the comma issue on Samsung devices. I am using a custom Entry implementation in platform independent XAML content page. In the Android project I am then using a custom entry renderer that overrides the OnElementChanged method. My sample code snippet looks like this:
`protected override void OnElementChanged(ElementChangedEventArgs e)
{
base.OnElementChanged(e);
That does the trick for me and now I can enter commas also on Samsung devices.