diff options
author | E.Z. Hart <hartez@gmail.com> | 2017-01-25 11:54:54 -0700 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2017-02-17 11:11:46 +0000 |
commit | 2ad9cb93f47f46fcb0584370ab8c297b20912718 (patch) | |
tree | 96868b61a3a9da1fa98ce4bb0d74e7d0c61e76c8 /Xamarin.Forms.Controls.Issues | |
parent | a1c7f9909a16d3253d9afd5cb2e1a839c6fb5a8c (diff) | |
download | xamarin-forms-2ad9cb93f47f46fcb0584370ab8c297b20912718.tar.gz xamarin-forms-2ad9cb93f47f46fcb0584370ab8c297b20912718.tar.bz2 xamarin-forms-2ad9cb93f47f46fcb0584370ab8c297b20912718.zip |
Add localized listener for Android numeric input
Diffstat (limited to 'Xamarin.Forms.Controls.Issues')
2 files changed, 66 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42000.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42000.cs new file mode 100644 index 00000000..77436bcd --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42000.cs @@ -0,0 +1,65 @@ +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; + +namespace Xamarin.Forms.Controls.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 42000, "Unable to use comma (\", \") as decimal point", PlatformAffected.Android)] + public class Bugzilla42000 : ContentPage + { + public Bugzilla42000() + { + var instructions = new Label + { + Text = + @"Change your system language settings and verify that you can type the correct decimal separator into the Entry and Editor controls below. +If your language is set to English (United States), you should be able to type '2.5', but not '2.5.3' or '2,5'. +If your language is set to Deutsch (Deutschland), you should be able to type '2,5', but not '2,5,3' or '2.5'. +" + }; + + var entrylabel = new Label { Text = "Entry:" }; + var entry = new Entry { Keyboard = Keyboard.Numeric }; + + var editorlabel = new Label { Text = "Editor:" }; + var editor = new Editor { Keyboard = Keyboard.Numeric }; + + var customRendererInstructions = new Label + { + Margin = new Thickness(0, 40, 0, 0), + Text = @"The two entries below demonstrate disabling decimal separators and negative numbers, respectively. +In the first one, neither '.' nor ',' should be typeable. +In the second, the '-' should not be typeable." + }; + + var entryNoDecimal = new _42000NumericEntryNoDecimal { Keyboard = Keyboard.Numeric }; + var entryNoNegative = new _42000NumericEntryNoNegative { Keyboard = Keyboard.Numeric }; + + Content = new StackLayout + { + VerticalOptions = LayoutOptions.Center, + Children = + { + instructions, + entrylabel, + entry, + editorlabel, + editor, + customRendererInstructions, + entryNoDecimal, + entryNoNegative + } + }; + } + + [Preserve(AllMembers = true)] + public class _42000NumericEntryNoDecimal : Entry + { + } + + [Preserve(AllMembers = true)] + public class _42000NumericEntryNoNegative : Entry + { + } + } +}
\ No newline at end of file diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems index e98c36c8..e5119636 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems @@ -132,6 +132,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla41424.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla41600.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla41619.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Bugzilla42000.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla42069.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla42069_Page.xaml.cs"> <DependentUpon>Bugzilla42069_Page.xaml</DependentUpon> |