summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android/Renderers/LabelRenderer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.Android/Renderers/LabelRenderer.cs')
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/LabelRenderer.cs14
1 files changed, 13 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.Android/Renderers/LabelRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/LabelRenderer.cs
index c544a239..ab1a6a35 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/LabelRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/LabelRenderer.cs
@@ -4,8 +4,8 @@ using Android.Content.Res;
using Android.Graphics;
using Android.Text;
using Android.Util;
+using Android.Views;
using Android.Widget;
-using AColor = Android.Graphics.Color;
namespace Xamarin.Forms.Platform.Android
{
@@ -23,6 +23,8 @@ namespace Xamarin.Forms.Platform.Android
FormsTextView _view;
bool _wasFormatted;
+ readonly MotionEventHelper _motionEventHelper = new MotionEventHelper();
+
public LabelRenderer()
{
AutoPackage = false;
@@ -97,6 +99,8 @@ namespace Xamarin.Forms.Platform.Android
if (e.OldElement.HorizontalTextAlignment != e.NewElement.HorizontalTextAlignment || e.OldElement.VerticalTextAlignment != e.NewElement.VerticalTextAlignment)
UpdateGravity();
}
+
+ _motionEventHelper.UpdateElement(e.NewElement);
}
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
@@ -217,5 +221,13 @@ namespace Xamarin.Forms.Platform.Android
_lastSizeRequest = null;
}
+
+ public override bool OnTouchEvent(MotionEvent e)
+ {
+ if (base.OnTouchEvent(e))
+ return true;
+
+ return _motionEventHelper.HandleMotionEvent(Parent);
+ }
}
} \ No newline at end of file