From 813b953360c5dde98b0de0fc03fce849cd6c7edc Mon Sep 17 00:00:00 2001 From: "E.Z. Hart" Date: Fri, 15 Sep 2017 08:37:09 -0600 Subject: Fix failing UI tests for Android FormsApplicationActivity (#1141) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix broken test for 57910 when using FormsApplicationActivity * Fix NRE when removing a page during OnAppearing using FormsApplicationActivity * Update 45926 test to work correctly with FormsApplicationActivity * Update 32830 test so it doesn't crash on FormsApplicationActivity * Longer wait before refreshing appearing messages (to work with FormsApplicationActivity) * Fix input transparency issue with old FrameRenderer * Remove extraneous using directive * Just ignore test 32830 on FormsApplicationActivity * [Controls] Add missing directive --- Xamarin.Forms.Platform.Android/Renderers/FrameRenderer.cs | 11 +++++++++++ .../Renderers/NavigationRenderer.cs | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'Xamarin.Forms.Platform.Android') diff --git a/Xamarin.Forms.Platform.Android/Renderers/FrameRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/FrameRenderer.cs index 68c7fbc6..4d232e58 100644 --- a/Xamarin.Forms.Platform.Android/Renderers/FrameRenderer.cs +++ b/Xamarin.Forms.Platform.Android/Renderers/FrameRenderer.cs @@ -1,6 +1,7 @@ using System.ComponentModel; using Android.Graphics; using Android.Graphics.Drawables; +using Android.Views; using AButton = Android.Widget.Button; using ACanvas = Android.Graphics.Canvas; using GlobalResource = Android.Resource; @@ -10,6 +11,7 @@ namespace Xamarin.Forms.Platform.Android public class FrameRenderer : VisualElementRenderer { bool _disposed; + readonly MotionEventHelper _motionEventHelper = new MotionEventHelper(); protected override void Dispose(bool disposing) { @@ -22,6 +24,14 @@ namespace Xamarin.Forms.Platform.Android } } + public override bool OnTouchEvent(MotionEvent e) + { + if (base.OnTouchEvent(e)) + return true; + + return _motionEventHelper.HandleMotionEvent(Parent, e); + } + protected override void OnElementChanged(ElementChangedEventArgs e) { base.OnElementChanged(e); @@ -30,6 +40,7 @@ namespace Xamarin.Forms.Platform.Android { UpdateBackground(); UpdateCornerRadius(); + _motionEventHelper.UpdateElement(e.NewElement); } } diff --git a/Xamarin.Forms.Platform.Android/Renderers/NavigationRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/NavigationRenderer.cs index 109bb691..ebe54272 100644 --- a/Xamarin.Forms.Platform.Android/Renderers/NavigationRenderer.cs +++ b/Xamarin.Forms.Platform.Android/Renderers/NavigationRenderer.cs @@ -287,7 +287,10 @@ namespace Xamarin.Forms.Platform.Android } s_currentAnimation = null; tcs.TrySetResult(true); - ((Platform)Element.Platform).NavAnimationInProgress = false; + if (Element?.Platform != null) + { + ((Platform)Element.Platform).NavAnimationInProgress = false; + } } }); } } -- cgit v1.2.3