blob: b4952d027b08c707e6c8c92b554ab22de8c672ef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
using System;
using Android.Content;
using Android.OS;
using Xamarin.Forms;
using Xamarin.Forms.ControlGallery.Android;
using Xamarin.Forms.Controls.Issues;
using Xamarin.Forms.Platform.Android;
using AView = Android.Views.View;
[assembly: ExportRenderer(typeof(Bugzilla57114._57114View), typeof(_57114CustomRenderer))]
namespace Xamarin.Forms.ControlGallery.Android
{
public class _57114CustomRenderer : Platform.Android.AppCompat.ViewRenderer<Bugzilla57114._57114View, _57114NativeView>
{
protected override void OnElementChanged(ElementChangedEventArgs<Bugzilla57114._57114View> e)
{
if (e.NewElement != null && Control == null)
{
var view = new _57114NativeView(Context);
SetNativeControl(view);
}
base.OnElementChanged(e);
}
}
public class _57114NativeView : global::Android.Views.View
{
public _57114NativeView(Context context)
: base(context)
{
Touch += OnTouch;
}
void OnTouch(object sender, AView.TouchEventArgs e)
{
MessagingCenter.Send(this as object, Bugzilla57114._57114NativeGestureFiredMessage);
e.Handled = false;
}
}
}
|