summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@users.noreply.github.com>2017-09-15 08:37:09 -0600
committerRui Marinho <me@ruimarinho.net>2017-09-15 15:38:49 +0100
commit813b953360c5dde98b0de0fc03fce849cd6c7edc (patch)
tree8bc2afb570245d6037cf6cb64fc7d6833cf4868d /Xamarin.Forms.Platform.Android
parenta0252e5833b78c20ece85f530a8e0b383858789f (diff)
downloadxamarin-forms-813b953360c5dde98b0de0fc03fce849cd6c7edc.tar.gz
xamarin-forms-813b953360c5dde98b0de0fc03fce849cd6c7edc.tar.bz2
xamarin-forms-813b953360c5dde98b0de0fc03fce849cd6c7edc.zip
Fix failing UI tests for Android FormsApplicationActivity (#1141)
* 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
Diffstat (limited to 'Xamarin.Forms.Platform.Android')
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/FrameRenderer.cs11
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/NavigationRenderer.cs5
2 files changed, 15 insertions, 1 deletions
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<Frame>
{
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<Frame> 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;
+ }
} });
}
}