From 6746593020fb0959643786138977e54031edc227 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Javier=20Su=C3=A1rez=20Ruiz?= Date: Mon, 14 Oct 2019 17:48:33 +0200 Subject: [PATCH] [Android] Fixed CarouselView string EmptyView not displayed (#7822) fixes #7792 * Added sample * Updated sample * Fixed CarouselView issue not displaying string EmptyView * Fixed wrong controls shared projitems paths --- .../Issue7792.xaml | 20 ++++++++++ .../Issue7792.xaml.cs | 45 ++++++++++++++++++++++ .../Xamarin.Forms.Controls.Issues.Shared.projitems | 10 +++++ .../CollectionView/CarouselViewRenderer.cs | 1 + 4 files changed, 76 insertions(+) create mode 100644 Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7792.xaml create mode 100644 Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7792.xaml.cs diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7792.xaml b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7792.xaml new file mode 100644 index 0000000..effed94 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7792.xaml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7792.xaml.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7792.xaml.cs new file mode 100644 index 0000000..1d89caf --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7792.xaml.cs @@ -0,0 +1,45 @@ +using System.Collections.Generic; +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; +using System.Windows.Input; + +#if UITEST +using Xamarin.UITest; +using NUnit.Framework; +using Xamarin.UITest.iOS; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 7792, "(Android) CarouselView string EmptyView not displayed", PlatformAffected.Android)] + public partial class Issue7792 : TestContentPage + { + public Issue7792() + { +#if APP + Device.SetFlags(new List { CollectionView.CollectionViewExperimental }); + InitializeComponent(); +#endif + BindingContext = new Issue7792ViewModel(); + } + + protected override void Init() + { + + } + } + + [Preserve(AllMembers = true)] + public class Issue7792Model + { + public string Text1 { get; set; } + public string Text2 { get; set; } + } + + [Preserve(AllMembers = true)] + public class Issue7792ViewModel : BindableObject + { + public IList EmptyItems { get; private set; } + } +} \ 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 a271bc1..39622b3 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 @@ -62,6 +62,9 @@ Code + + Code + Code @@ -1415,6 +1418,9 @@ Issue7357.xaml + + Issue7792.xaml + Issue7789.xaml @@ -1504,6 +1510,10 @@ + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/Xamarin.Forms.Platform.Android/CollectionView/CarouselViewRenderer.cs b/Xamarin.Forms.Platform.Android/CollectionView/CarouselViewRenderer.cs index 7b57653..fcd581b 100644 --- a/Xamarin.Forms.Platform.Android/CollectionView/CarouselViewRenderer.cs +++ b/Xamarin.Forms.Platform.Android/CollectionView/CarouselViewRenderer.cs @@ -50,6 +50,7 @@ namespace Xamarin.Forms.Platform.Android protected override void UpdateItemsSource() { UpdateAdapter(); + UpdateEmptyView(); } protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs changedProperty) -- 2.7.4