summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android/Renderers/ButtonRenderer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.Android/Renderers/ButtonRenderer.cs')
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/ButtonRenderer.cs26
1 files changed, 0 insertions, 26 deletions
diff --git a/Xamarin.Forms.Platform.Android/Renderers/ButtonRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/ButtonRenderer.cs
index e07a2be5..4f384b3b 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/ButtonRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/ButtonRenderer.cs
@@ -7,8 +7,6 @@ using Android.Util;
using static System.String;
using AButton = Android.Widget.Button;
using AView = Android.Views.View;
-using AMotionEvent = Android.Views.MotionEvent;
-using AMotionEventActions = Android.Views.MotionEventActions;
using Object = Java.Lang.Object;
namespace Xamarin.Forms.Platform.Android
@@ -98,7 +96,6 @@ namespace Xamarin.Forms.Platform.Android
{
button = CreateNativeControl();
button.SetOnClickListener(ButtonClickListener.Instance.Value);
- button.SetOnTouchListener(ButtonTouchListener.Instance.Value);
button.Tag = this;
SetNativeControl(button);
_textColorSwitcher = new TextColorSwitcher(button.TextColors);
@@ -306,28 +303,5 @@ namespace Xamarin.Forms.Platform.Android
((IButtonController)renderer.Element).SendClicked();
}
}
-
- class ButtonTouchListener : Object, IOnTouchListener
- {
- public static readonly Lazy<ButtonTouchListener> Instance = new Lazy<ButtonTouchListener>(() => new ButtonTouchListener());
-
- public bool OnTouch(AView v, AMotionEvent e)
- {
- var renderer = v.Tag as ButtonRenderer;
- if (renderer != null)
- {
- var buttonController = renderer.Element as IButtonController;
- if (e.Action == AMotionEventActions.Down)
- {
- buttonController?.SendPressed();
- }
- else if (e.Action == AMotionEventActions.Up)
- {
- buttonController?.SendReleased();
- }
- }
- return false;
- }
- }
}
} \ No newline at end of file