protected override void OnAttached()
        {
            if (Control is ListView || Control is ScrollView)
            {
                return;
            }

            View.Clickable     = true;
            View.LongClickable = true;
            _viewOverlay       = new FrameLayout(Container.Context)
            {
                LayoutParameters = new ViewGroup.LayoutParams(-1, -1),
                Clickable        = false,
                Focusable        = false,
            };
            Container.LayoutChange += ViewOnLayoutChange;

            if (EnableRipple)
            {
                _viewOverlay.Background = CreateRipple(_color);
            }

            SetEffectColor();
            TouchCollector.Add(View, OnTouch);

            Container.AddView(_viewOverlay);
            _viewOverlay.BringToFront();
        }
 protected override void OnAttached()
 {
     View.Clickable           = true;
     View.LongClickable       = true;
     View.SoundEffectsEnabled = true;
     TouchCollector.Add(View, OnTouch);
 }
 protected override void OnDetached()
 {
     if (IsDisposed)
     {
         return;
     }
     TouchCollector.Delete(View, OnTouch);
 }
        protected override void OnDetached()
        {
            if (IsDisposed)
            {
                return;
            }

            Container.RemoveView(_viewOverlay);
            _viewOverlay.Pressed    = false;
            _viewOverlay.Foreground = null;
            _viewOverlay.Dispose();
            Container.LayoutChange -= ViewOnLayoutChange;

            if (EnableRipple)
            {
                _ripple?.Dispose();
            }

            TouchCollector.Delete(View, OnTouch);
        }
 void Start()
 {
     _touch = GetComponent<TouchCollector>();
     _touch.OnTouch += Collect;
 }
 void Start()
 {
     _touch = GetComponent<TouchCollector>();
     _touch.OnCollide     += Collide;
 }