summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues
diff options
context:
space:
mode:
authoradrianknight89 <adrianknight89@outlook.com>2017-02-13 07:47:59 -0600
committerRui Marinho <me@ruimarinho.net>2017-02-13 13:47:59 +0000
commitf0711c6aa6d446e70adec8cf7dace437d0930352 (patch)
treea3b3928e42329b5960bad08526bac725a7b0754d /Xamarin.Forms.Controls.Issues
parentc2a6bb05b1fe9e530652445e7c8101cfb39155bd (diff)
downloadxamarin-forms-f0711c6aa6d446e70adec8cf7dace437d0930352.tar.gz
xamarin-forms-f0711c6aa6d446e70adec8cf7dace437d0930352.tar.bz2
xamarin-forms-f0711c6aa6d446e70adec8cf7dace437d0930352.zip
[Android] Double tapping on context action should not crash (#609)
* fix double tap nre * added sample code * new fix * added comment * better fix * edit position of change * changes
Diffstat (limited to 'Xamarin.Forms.Controls.Issues')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla45027.cs66
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems1
2 files changed, 67 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla45027.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla45027.cs
new file mode 100644
index 00000000..260967be
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla45027.cs
@@ -0,0 +1,66 @@
+using System.Collections.Generic;
+using Xamarin.Forms.CustomAttributes;
+using Xamarin.Forms.Internals;
+
+#if UITEST
+using Xamarin.UITest;
+using NUnit.Framework;
+#endif
+
+namespace Xamarin.Forms.Controls.Issues
+{
+ [Preserve(AllMembers = true)]
+ [Issue(IssueTracker.Bugzilla, 45027, "App crashes when double tapping on ToolbarItem or MenuItem very quickly", PlatformAffected.Android)]
+ public class Bugzilla45027 : TestContentPage // or TestMasterDetailPage, etc ...
+ {
+ protected override void Init()
+ {
+ var list = new List<int>();
+ for (var i = 0; i < 10; i++)
+ list.Add(i);
+
+ var stackLayout = new StackLayout
+ {
+ Orientation = StackOrientation.Vertical,
+ Children =
+ {
+ new Label
+ {
+ Text = "Long tap list items to display context menu. Double tapping each action rapidly should not crash.",
+ HorizontalTextAlignment = TextAlignment.Center
+ }
+ }
+ };
+
+ var listView = new ListView
+ {
+ ItemsSource = list,
+ ItemTemplate = new DataTemplate(() =>
+ {
+ var label = new Label();
+ label.SetBinding(Label.TextProperty, new Binding("."));
+
+ return new ViewCell
+ {
+ View = new ContentView
+ {
+ Content = label,
+ },
+ ContextActions = { new MenuItem
+ {
+ Text = "Action"
+ },
+ new MenuItem
+ {
+ Text = "Delete",
+ IsDestructive = true
+ } }
+ };
+ })
+ };
+ stackLayout.Children.Add(listView);
+
+ Content = stackLayout;
+ }
+ }
+} \ 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 742c29a7..c69e1a31 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
@@ -157,6 +157,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla42832.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla44044.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla44338.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla45027.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla45330.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla45743.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla46494.cs" />