summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android/Renderers/BoxRenderer.cs
diff options
context:
space:
mode:
authorJason Smith <jason.smith@xamarin.com>2016-04-08 09:16:02 -0700
committerRui Marinho <me@ruimarinho.net>2016-04-08 17:16:02 +0100
commite9f655688586bc0eb4183507def7ed3f774b7c71 (patch)
tree24aaba13b7a44468bb0989055813b11fdb5baf6f /Xamarin.Forms.Platform.Android/Renderers/BoxRenderer.cs
parent870f9c98ffccce86d80c6ff7a05de7238fc1b0e8 (diff)
downloadxamarin-forms-e9f655688586bc0eb4183507def7ed3f774b7c71.tar.gz
xamarin-forms-e9f655688586bc0eb4183507def7ed3f774b7c71.tar.bz2
xamarin-forms-e9f655688586bc0eb4183507def7ed3f774b7c71.zip
[A] Fix Bugzilla 40173 (#62)
* [A]Fix issue where Frame would block all tap gestures under it even if it didn't have one * [A]Make BoxView non-blocking inside a ListView only * Add UITest for bz40173 * Fix code review issues
Diffstat (limited to 'Xamarin.Forms.Platform.Android/Renderers/BoxRenderer.cs')
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/BoxRenderer.cs22
1 files changed, 20 insertions, 2 deletions
diff --git a/Xamarin.Forms.Platform.Android/Renderers/BoxRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/BoxRenderer.cs
index 725829f4..b29dd760 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/BoxRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/BoxRenderer.cs
@@ -5,6 +5,8 @@ namespace Xamarin.Forms.Platform.Android
{
public class BoxRenderer : VisualElementRenderer<BoxView>
{
+ bool _isInViewCell;
+
public BoxRenderer()
{
AutoPackage = false;
@@ -12,13 +14,29 @@ namespace Xamarin.Forms.Platform.Android
public override bool OnTouchEvent(MotionEvent e)
{
- base.OnTouchEvent(e);
- return !Element.InputTransparent;
+ if (base.OnTouchEvent(e))
+ return true;
+ return !Element.InputTransparent && !_isInViewCell;
}
protected override void OnElementChanged(ElementChangedEventArgs<BoxView> e)
{
base.OnElementChanged(e);
+
+ if (e.NewElement != null)
+ {
+ var parent = e.NewElement.Parent;
+ while (parent != null)
+ {
+ if (parent is ViewCell)
+ {
+ _isInViewCell = true;
+ break;
+ }
+ parent = parent.Parent;
+ }
+ }
+
UpdateBackgroundColor();
}