diff options
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla33561.cs')
-rw-r--r-- | Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla33561.cs | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla33561.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla33561.cs new file mode 100644 index 00000000..ec55d370 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla33561.cs @@ -0,0 +1,57 @@ +using System; + +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; +using System.Linq; +using System.Threading.Tasks; + +namespace Xamarin.Forms.Controls +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 33561, "ListView Pull-to-Refresh ActivityIndicator animation stuck when navigating away and then back again")] + public class Bugzilla33561 : TestTabbedPage + { + public class ListPage : ContentPage + { + ListView _listView; + bool _isRefreshing; + + public ListPage() + { + var template = new DataTemplate(typeof(TextCell)); + template.SetBinding(TextCell.TextProperty, "."); + + _listView = new ListView() + { + IsPullToRefreshEnabled = true, + ItemsSource = Enumerable.Range(0, 10).Select(no => $"FAIL {no}"), + ItemTemplate = template, + IsRefreshing = true + }; + + _listView.Refreshing += async (object sender, EventArgs e) => + { + if (_isRefreshing) + return; + + _isRefreshing = true; + await Task.Delay(10000); + _listView.EndRefresh(); + _listView.ItemsSource = Enumerable.Range(0, 10).Select(no => $"SUCCESS {no}"); + _isRefreshing = false; + }; + + Content = _listView; + + Device.StartTimer(TimeSpan.FromSeconds(5), () => { _listView.IsRefreshing = false; return false; }); + } + } + + protected override void Init() + { + Children.Add(new NavigationPage(new ListPage()) { Title = "page 1" }); + Children.Add(new ContentPage() { Title = "page 2" }); + Children.Add(new ContentPage() { Title = "page 3" }); + } + } +} |