<commit_before>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.App.Usage;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using XFExtensions.Controls.Abstractions;
using XFExtensions.Controls.Droid;
using System.Threading.Tasks;

[assembly: ExportRenderer(typeof(GestureView), typeof(GestureViewRenderer))]
namespace XFExtensions.Controls.Droid
{
    #region Gesture View Renderer

    public class GestureViewRenderer : ViewRenderer
    {
        private readonly DroidGestureViewTouchListener _listener;
        private readonly GestureDetector _detector;

        public GestureViewRenderer()
        {
            _listener = new DroidGestureViewTouchListener();
            _detector = new GestureDetector(_listener);
        }

        protected override async void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.View> e)
        {
            //base.OnElementChanged(e);

            if (e.NewElement != null)
            {
                this.GenericMotion += HandleGenericMotion;
                this.Touch += HandleTouch;
                _listener.SwipeLeft += HandleOnSwipeLeft;
                _listener.SwipeRight += HandleOnSwipeRight;
                _listener.SwipeUp += HandleOnSwipeTop;
                _listener.SwipeDown += HandleOnSwipeDown;

                _listener.DoubleTap += HandleOnDoubleTap;
                _listener.SingleTap += HandleOnSingleTap;
            }
            else
            {
                this.GenericMotion -= HandleGenericMotion;
                this.Touch -= HandleTouch;
                _listener.SwipeLeft -= HandleOnSwipeLeft;
                _listener.SwipeRight -= HandleOnSwipeRight;
                _listener.SwipeUp -= HandleOnSwipeTop;
                _listener.SwipeDown -= HandleOnSwipeDown;

                _listener.DoubleTap -= HandleOnDoubleTap;
                _listener.SingleTap -= HandleOnSingleTap;
            }
        }

        public override bool OnInterceptTouchEvent(MotionEvent ev)
        {
            var v = GetViewWithTouchHandler(this, ev);
            if (v == null)
                return true;
            return false;
        }

        private Android.Views.View GetViewWithTouchHandler(Android.Views.View view, MotionEvent ev)
        {
            var viewGroup = view as ViewGroup;
            if (viewGroup != null)
            {
                for (var i = 0; i < viewGroup.ChildCount; i++)
                {
                    var c = GetViewWithTouchHandler(viewGroup.GetChildAt(i), ev);
                    if (c != null)
                        return c;
                }
            }
            else
            {
                var handled = view.OnTouchEvent(ev);
                if (handled)
                    return view;
            }
            return null;
        }

        void HandleTouch(object sender, TouchEventArgs e)
        {
            _detector.OnTouchEvent(e.Event);
        }

        void HandleGenericMotion(object sender, GenericMotionEventArgs e)
        {
            _detector.OnTouchEvent(e.Event);
        }<commit_msg>Looks like Xamarin has resolved the event swallowing bug, it's working now.<commit_after>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.App.Usage;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using XFExtensions.Controls.Abstractions;
using XFExtensions.Controls.Droid;
using System.Threading.Tasks;


[assembly: ExportRenderer(typeof(GestureView), typeof(GestureViewRenderer))]
namespace XFExtensions.Controls.Droid
{
    #region Gesture View Renderer

    public class GestureViewRenderer : ViewRenderer
    {
        private readonly DroidGestureViewTouchListener _listener;
        private readonly GestureDetector _detector;

        public GestureViewRenderer()
        {
            _listener = new DroidGestureViewTouchListener();
            _detector = new GestureDetector(_listener);
        }

        protected override async void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.View> e)
        {
            //base.OnElementChanged(e);

            if (e.NewElement != null)
            {
                this.GenericMotion += HandleGenericMotion;
                this.Touch += HandleTouch;
                _listener.SwipeLeft += HandleOnSwipeLeft;
                _listener.SwipeRight += HandleOnSwipeRight;
                _listener.SwipeUp += HandleOnSwipeTop;
                _listener.SwipeDown += HandleOnSwipeDown;

                _listener.DoubleTap += HandleOnDoubleTap;
                _listener.SingleTap += HandleOnSingleTap;
            }
            else
            {
                this.GenericMotion -= HandleGenericMotion;
                this.Touch -= HandleTouch;
                _listener.SwipeLeft -= HandleOnSwipeLeft;
                _listener.SwipeRight -= HandleOnSwipeRight;
                _listener.SwipeUp -= HandleOnSwipeTop;
                _listener.SwipeDown -= HandleOnSwipeDown;

                _listener.DoubleTap -= HandleOnDoubleTap;
                _listener.SingleTap -= HandleOnSingleTap;
            }
        }

        void HandleTouch(object sender, TouchEventArgs e)
        {
            _detector.OnTouchEvent(e.Event);
        }

        void HandleGenericMotion(object sender, GenericMotionEventArgs e)
        {
            _detector.OnTouchEvent(e.Event);
        }
{'fraction_non_alphanumeric': 0.07473684210526316, 'fraction_numerical': 0.00017543859649122806, 'mean_word_length': 1.9754697286012526, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '260100', 'n_tokens_mistral': 1516, 'n_tokens_neox': 1442, 'n_words': 299}