2016-03-22 23:02:25 +03:00
|
|
|
using Xamarin.Forms.CustomAttributes;
|
2016-04-26 18:20:55 +03:00
|
|
|
using Xamarin.Forms.Internals;
|
2016-03-22 23:02:25 +03:00
|
|
|
|
|
|
|
#if UITEST
|
|
|
|
using NUnit.Framework;
|
2017-09-15 21:49:19 +03:00
|
|
|
using Xamarin.Forms.Core.UITests;
|
2016-03-22 23:02:25 +03:00
|
|
|
using Xamarin.UITest.Queries;
|
|
|
|
#endif
|
|
|
|
|
2016-11-17 00:07:30 +03:00
|
|
|
namespace Xamarin.Forms.Controls.Issues
|
2016-03-22 23:02:25 +03:00
|
|
|
{
|
2017-09-15 21:49:19 +03:00
|
|
|
#if UITEST
|
|
|
|
[Category(UITestCategories.Gestures)]
|
|
|
|
#endif
|
|
|
|
|
2016-03-22 23:02:25 +03:00
|
|
|
[Preserve (AllMembers = true)]
|
|
|
|
[Issue (IssueTracker.Bugzilla, 35477, "Tapped event does not fire when added to Frame in Android AppCompat",
|
|
|
|
PlatformAffected.Android)]
|
|
|
|
public class Bugzilla35477 : TestContentPage
|
|
|
|
{
|
|
|
|
protected override void Init ()
|
|
|
|
{
|
|
|
|
var instructions = new Label {
|
|
|
|
Text = "Tap the frame below. The label with the text 'No taps yet' should change its text to 'Frame was tapped'."
|
|
|
|
};
|
|
|
|
var frame = new Frame () {};
|
|
|
|
var frameLabel = new Label() {Text = "Tap here" };
|
|
|
|
|
|
|
|
frame.Content = new StackLayout() {Children = { frameLabel }};
|
|
|
|
|
|
|
|
var label = new Label { Text = "No taps yet" };
|
|
|
|
|
|
|
|
var rec = new TapGestureRecognizer { NumberOfTapsRequired = 1 };
|
|
|
|
rec.Tapped += (s, e) => { label.Text = "Frame was tapped"; };
|
|
|
|
frame.GestureRecognizers.Add (rec);
|
|
|
|
|
|
|
|
Content = new StackLayout {
|
|
|
|
Children = { instructions, frame, label }
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#if UITEST
|
|
|
|
[Test]
|
|
|
|
public void TapGestureFiresOnFrame ()
|
|
|
|
{
|
|
|
|
RunningApp.WaitForElement ("No taps yet");
|
|
|
|
RunningApp.WaitForElement ("Tap here");
|
|
|
|
|
|
|
|
RunningApp.Tap ("Tap here");
|
|
|
|
|
|
|
|
RunningApp.WaitForElement ("Frame was tapped");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|