2016-03-22 23:02:25 +03:00
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
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
|
2016-11-15 22:39:23 +03:00
|
|
|
|
using Xamarin.Forms.Core.UITests;
|
2016-03-22 23:02:25 +03:00
|
|
|
|
using Xamarin.UITest;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
#endif
|
|
|
|
|
|
2016-11-17 00:07:30 +03:00
|
|
|
|
namespace Xamarin.Forms.Controls.Issues
|
2016-03-22 23:02:25 +03:00
|
|
|
|
{
|
2016-11-15 22:39:23 +03:00
|
|
|
|
#if UITEST
|
|
|
|
|
[Category(UITestCategories.ListView)]
|
|
|
|
|
#endif
|
|
|
|
|
|
2016-03-22 23:02:25 +03:00
|
|
|
|
[Preserve (AllMembers = true)]
|
|
|
|
|
[Issue (IssueTracker.Bugzilla, 32462, "Crash after a page disappeared if a ScrollView is in the HeaderTemplate property of a ListView", PlatformAffected.Android)]
|
|
|
|
|
public class Bugzilla32462 : TestContentPage // or TestMasterDetailPage, etc ...
|
|
|
|
|
{
|
|
|
|
|
[Preserve (AllMembers = true)]
|
|
|
|
|
public class ListViewPage : ContentPage
|
|
|
|
|
{
|
|
|
|
|
public ListViewPage ()
|
|
|
|
|
{
|
|
|
|
|
var scrollview = new ScrollView {
|
|
|
|
|
Orientation = ScrollOrientation.Horizontal,
|
|
|
|
|
Content = new Label { Text = "some looooooooooooooooooooooooooooooooooooooooooooooooooooooog text" }
|
|
|
|
|
};
|
|
|
|
|
var stacklayout = new StackLayout ();
|
|
|
|
|
stacklayout.Children.Add (scrollview);
|
|
|
|
|
string[] list = Enumerable.Range (0, 40).Select (c => $"some text {c}").ToArray ();
|
|
|
|
|
var listview = new ListView { AutomationId = "listview", Header = stacklayout, ItemsSource = list };
|
|
|
|
|
Content = listview;
|
|
|
|
|
|
|
|
|
|
listview.ScrollTo (list[39], ScrollToPosition.Center, false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Init ()
|
|
|
|
|
{
|
|
|
|
|
var button = new Button {
|
|
|
|
|
Text = "Click!",
|
|
|
|
|
};
|
|
|
|
|
button.Clicked += (object sender, EventArgs e) => Navigation.PushAsync (new ListViewPage ());
|
|
|
|
|
Content = button;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if UITEST
|
|
|
|
|
[Test]
|
|
|
|
|
public void Bugzilla36729Test ()
|
|
|
|
|
{
|
|
|
|
|
RunningApp.WaitForElement (q => q.Marked ("Click!"));
|
|
|
|
|
RunningApp.Tap (q => q.Marked ("Click!"));
|
|
|
|
|
RunningApp.WaitForElement (q => q.Marked ("listview"));
|
|
|
|
|
RunningApp.WaitForElement (q => q.Marked ("some text 35"));
|
|
|
|
|
RunningApp.Back ();
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
}
|