Esempio n. 1
0
        public override void TouchesEnded(NSSet touches, UIEvent evt)
        {
            base.TouchesEnded(touches, evt);

            UITouch touch = touches.AnyObject as UITouch;

            var cgPoint = touch.LocationInView(this);
            var point   = new SKPoint((float)this.ContentScaleFactor * (float)cgPoint.X, (float)this.ContentScaleFactor * (float)cgPoint.Y);
            var rect    = new SKRect(point.X - 25f, point.Y - 25f, point.X + 50f, point.Y + 50f);

            // if touch ended within current viewbox!
            if (trashButton.TouchUpInside(rect))
            {
                TrashButtonTouched?.Invoke(this, new EventArgs());
                // fire Event
                // TakeButtonTouched?.Invoke(this, new EventArgs());
            }

            if (closeButton.TouchUpInside(rect))
            {
                CloseButtonTouched?.Invoke(this, new EventArgs());
            }

            trashButton.Touched = false;
            closeButton.Touched = false;
        }
        public override void TouchesEnded(NSSet touches, UIEvent evt)
        {
            base.TouchesEnded(touches, evt);
            UITouch touch = touches.AnyObject as UITouch;

            var cgPoint = touch.LocationInView(this);
            var point   = new SKPoint((float)ContentScaleFactor * (float)cgPoint.X, (float)ContentScaleFactor * (float)cgPoint.Y);
            var rect    = new SKRect(point.X - 25f, point.Y - 25f, point.X + 50f, point.Y + 50f);

            if (closeButton.TouchUpInside(rect))
            {
                CloseButtonTouched?.Invoke(this, new EventArgs());
            }

            if (trashButton.TouchUpInside(rect))
            {
                TrashButtonTouched?.Invoke(this, new EventArgs());
            }

            if (sendButton.TouchUpInside(rect))
            {
                SendButtonTouched?.Invoke(this, new EventArgs());
            }

            buttons.ForEach((btn) => btn.Touched = false);
        }
Esempio n. 3
0
        void ControlsOverlayView_TrashButtonTouched(object sender, EventArgs e)
        {
            takenPhotosOverlayView.RemoveLastTappedCell();
            TrashButtonTouched?.Invoke(this, new EventArgs());

            if (Photos.Count == 0)
            {
                CloseButtonTouched?.Invoke(this, new EventArgs());
            }
            else
            {
                takenPhotosOverlayView.SelectLastItem();
            }
        }
Esempio n. 4
0
        public override void TouchesEnded(NSSet touches, UIEvent evt)
        {
            base.TouchesEnded(touches, evt);
            UITouch touch = touches.AnyObject as UITouch;

            var cgPoint = touch.LocationInView(this);
            var point   = new SKPoint((float)this.ContentScaleFactor * (float)cgPoint.X, (float)this.ContentScaleFactor * (float)cgPoint.Y);
            var rect    = new SKRect(point.X - 25f, point.Y - 25f, point.X + 50f, point.Y + 50f);

            // if touch ended within current viewbox!
            if (takeButton.TouchUpInside(rect))
            {
                TakeButtonTouched?.Invoke(this, new EventArgs());
                Counter++;
            }

            if (flashButton.TouchUpInside(rect))
            {
                FlashButtonTouched?.Invoke(this, new EventArgs());
            }

            if (cameraButton.TouchUpInside(rect))
            {
                CameraButtonTouched?.Invoke(this, new EventArgs());
            }

            if (closeButton.TouchUpInside(rect))
            {
                CloseButtonTouched?.Invoke(this, new EventArgs());
            }

            if (sendButton.TouchUpInside(rect))
            {
                SendButtonTouched?.Invoke(this, new EventArgs());
            }

            if (counterButton.TouchUpInside(rect))
            {
                CounterButtonTouched?.Invoke(this, new EventArgs());
            }

            buttons.ForEach((btn) => btn.Touched = false);
        }
Esempio n. 5
0
 void ControlsOverlayView_CloseButtonTouched(object sender, EventArgs e)
 {
     CloseButtonTouched?.Invoke(this, new EventArgs());
 }