-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Issue3415.cs
53 lines (48 loc) · 1.18 KB
/
Issue3415.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 3415, "[Android] Swipe Command fires twice on Android for each swipe action", PlatformAffected.Android)]
public class Issue3415 : TestContentPage
{
protected override void Init()
{
Label rightSwipeFired = new Label();
Label leftSwipeFired = new Label();
Content = new StackLayout()
{
Children = {
new Label(){ Text = "Swipe Anywhere on the Screen. Android fires swipe events twice"},
rightSwipeFired,
leftSwipeFired
},
BackgroundColor = Color.Green
};
int right = 0;
int left = 0;
Content
.GestureRecognizers
.Add(new SwipeGestureRecognizer()
{
Direction = SwipeDirection.Right,
Command = new Command(() =>
{
right++;
rightSwipeFired.Text = $"Right Swipe: {right}";
})
});
Content
.GestureRecognizers
.Add(new SwipeGestureRecognizer()
{
Direction = SwipeDirection.Left,
Command = new Command(() =>
{
left++;
leftSwipeFired.Text = $"Left Swipe: {left}";
})
});
}
}
}