diff options
author | Rui Marinho <me@ruimarinho.net> | 2016-09-15 18:33:39 +0100 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-09-15 10:33:39 -0700 |
commit | d3cf333590a1c762e04e3083003076e1d23cdcf5 (patch) | |
tree | de26d61e782aae622f2415a5d07094f859806bfc | |
parent | 9f361c7e723bd685eeb0a8946930b7c0f9a96bb2 (diff) | |
download | xamarin-forms-d3cf333590a1c762e04e3083003076e1d23cdcf5.tar.gz xamarin-forms-d3cf333590a1c762e04e3083003076e1d23cdcf5.tar.bz2 xamarin-forms-d3cf333590a1c762e04e3083003076e1d23cdcf5.zip |
[Android] Fix failing UITests (#356)
-rw-r--r-- | Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs | 18 | ||||
-rw-r--r-- | Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43161.cs | 5 |
2 files changed, 19 insertions, 4 deletions
diff --git a/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs b/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs index 7f86a85d..a550212c 100644 --- a/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs +++ b/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs @@ -16,6 +16,7 @@ using Android.Content; using Android.Runtime; using Android.Util; using AButton = Android.Widget.Button; +using AView = Android.Views.View; using Android.OS; using System.Reflection; @@ -44,7 +45,7 @@ namespace Xamarin.Forms.ControlGallery.Android } _page = newElement as MasterDetailPage; - _page.PropertyChanged += Page_PropertyChanged; + _page.PropertyChanged += Page_PropertyChanged; _page.LayoutChanged += Page_LayoutChanged; } @@ -416,10 +417,23 @@ namespace Xamarin.Forms.ControlGallery.Android return view; } } - public abstract class CustomContentRenderer : ViewRenderer + + [Preserve] + public class CustomContentRenderer : ViewRenderer { + [Preserve] + public CustomContentRenderer() + { + AutoPackage = true; + } + + protected override AView CreateNativeControl() + { + return new AView(Context); + } } + [Preserve] public class CustomNativeButton : AButton { public CustomNativeButton(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer) diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43161.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43161.cs index 159c793d..3a45cc84 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43161.cs +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43161.cs @@ -9,6 +9,7 @@ using NUnit.Framework; namespace Xamarin.Forms.Controls { + [Preserve(AllMembers = true)] [Issue(IssueTracker.Bugzilla, 43161, "[iOS] Setting Accessory in ViewCellRenderer breaks layout", PlatformAffected.iOS)] public class Bugzilla43161 : TestContentPage @@ -51,7 +52,7 @@ namespace Xamarin.Forms.Controls Content = new StackLayout { Children = { label, listView, listView2, listView3 } }; } -#if UITEST +#if (UITEST && __IOS__) [Test] public void Bugzilla43161Test() { @@ -61,4 +62,4 @@ namespace Xamarin.Forms.Controls } #endif } -}
\ No newline at end of file +} |