Example #1
0
        internal OnTouchListener(NativeGestureHandler nativeGestureHandler)
        {
            P42.Utils.Debug.AddToCensus(this);

            _nativeGestureHandler = nativeGestureHandler;
            _nativeListener       = new NativeGestureListener(_nativeGestureHandler.Renderer.View, _nativeGestureHandler.Element);
            _nativeDetector       = new NativeGestureDetector(Droid.Settings.Context, _nativeListener);
        }
 internal void ClearGestureRecognizers()
 {
     nativeDetector?.Dispose();
     nativeDetector = null;
     nativeListener?.Dispose();
     nativeListener = null;
     RemoveTouchHandler();
 }
 internal void ResetGestureRecognizers(Android.Views.View view)
 {
     ClearGestureRecognizers();
     nativeListener = new NativeGestureListener(view, _listeners);
     nativeDetector = new NativeGestureDetector(Droid.Settings.Context, nativeListener);
     view.Touch    += HandleTouch;
     //_weakReferenceView = new Java.Lang.Ref.WeakReference(view);
 }
Example #4
0
        internal OnTouchListener(NativeGestureHandler nativeGestureHandler)
        {
            P42.Utils.DebugExtensions.AddToCensus(this);

            _nativeGestureHandler = nativeGestureHandler;
            _nativeListener       = new NativeGestureListener(_nativeGestureHandler.Renderer.View, _nativeGestureHandler.Element);
            Xamarin.Essentials.MainThread.BeginInvokeOnMainThread(() =>
                                                                  _nativeDetector = new NativeGestureDetector(Droid.Settings.Context, _nativeListener));
        }
Example #5
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         _nativeDetector?.Dispose();
         _nativeDetector = null;
         _nativeListener?.Dispose();
         _nativeListener       = null;
         _nativeGestureHandler = null;
     }
     base.Dispose(disposing);
 }
Example #6
0
        protected override void Dispose(bool disposing)
        {
            if (!_disposed && disposing)
            {
                _disposed = true;

                _nativeDetector?.Dispose();
                _nativeDetector = null;
                _nativeListener?.Dispose();
                _nativeListener = null;

                //_nativeGestureHandler?.Dispose();
                _nativeGestureHandler = null;

                P42.Utils.DebugExtensions.RemoveFromCensus(this);
            }
            base.Dispose(disposing);
        }
 internal OnTouchListener(NativeGestureHandler nativeGestureHandler)
 {
     _nativeGestureHandler = nativeGestureHandler;
     _nativeListener       = new NativeGestureListener(_nativeGestureHandler.Renderer.View, _nativeGestureHandler.Element);
     _nativeDetector       = new NativeGestureDetector(Droid.Settings.Context, _nativeListener);
 }