Esempio n. 1
0
        void endedGesture(UIGestureRecognizer gesture)
        {
            if (gesturesEnded)
            {
                return;
            }

            UIPinchGestureRecognizer pinch = (gesture.GetType() == typeof(UIPinchGestureRecognizer)) ?
                                             (UIPinchGestureRecognizer)gesture : null;

            if (scaleActive && pinch == null)
            {
                return;
            }

            gesturesEnded = true;
            if (pinch != null)
            {
                scaleActive = false;

                if (pinch.Velocity >= 2.0f)
                {
                    moveToFullScreenAnimated(true, true);
                }
                else
                {
                    alignViewAnimated(true, true);
                }
            }
            else
            {
                alignViewAnimated(true, true);
            }
        }
Esempio n. 2
0
		public override bool GestureRecognizerShouldBegin (UIGestureRecognizer gestureRecognizer)
		{
			if (gestureRecognizer.GetType () == typeof (UIPinchGestureRecognizer) && padTouch != null)
				return false;

			return true;
		}
Esempio n. 3
0
        void SlideAndFix(UIGestureRecognizer gesture)
        {
            UIView piece      = gesture.View;
            nfloat yComponent = piece.Superview.Center.Y - 40f;

            if (!ComponentExpanded || piece.Frame.Top < piece.Superview.Center.Y - 40f)
            {
                ComponentExpanded = true;
            }
            else
            {
                yComponent        = piece.Superview.Frame.Height - 40f;
                ComponentExpanded = false;
            }

            UIImageView.Animate(
                duration: 0.25f,
                delay: 0,
                options: UIViewAnimationOptions.TransitionNone,
                animation: () => {
                piece.Frame = new RectangleF(new PointF(piece.Frame.X, yComponent), piece.Frame.Size);

                if (gesture.GetType() == typeof(UIPanGestureRecognizer))
                {
                    var concreteType = (UIPanGestureRecognizer)gesture;
                    concreteType.SetTranslation(new PointF(0, 0), piece.Superview);
                }
            },
                completion: () => {
            });
        }
Esempio n. 4
0
        public bool gestureRecognizerShouldBegin(UIGestureRecognizer gestureRecognizer)
        {
            if (gestureRecognizer.GetType() == typeof(UIPinchGestureRecognizer))
            {
                beginZoomScale = zoomScale;
            }

            return(true);
        }
Esempio n. 5
0
 public virtual bool ShouldReceiveTouch(UIGestureRecognizer recognizer, UITouch touch)
 {
     if ((recognizer.GetType() == typeof(UITapGestureRecognizer)) && (touch.View.GetType() == typeof(UIButton)))
     {
         return(false);
     }
     Alpha = 1;
     return(true);
 }
Esempio n. 6
0
        public override bool GestureRecognizerShouldBegin(UIGestureRecognizer gestureRecognizer)
        {
            if (gestureRecognizer.GetType() == typeof(UIPinchGestureRecognizer) && padTouch != null)
            {
                return(false);
            }

            return(true);
        }
Esempio n. 7
0
        void modifiedGesture(UIGestureRecognizer gesture)
        {
            if (gesture.GetType() == typeof(UIPinchGestureRecognizer))
            {
                var pinch = (UIPinchGestureRecognizer)gesture;
                scaleTransform = CGAffineTransform.Scale(CGAffineTransform.MakeIdentity(), pinch.Scale, pinch.Scale);
            }
            else if (gesture.GetType() == typeof(UIRotationGestureRecognizer))
            {
                var rotate = (UIRotationGestureRecognizer)gesture;
                rotateTransform = CGAffineTransform.Rotate(CGAffineTransform.MakeIdentity(), rotate.Rotation);
            }
            else if (gesture.GetType() == typeof(UIPanGestureRecognizer))
            {
                var     pan         = (UIPanGestureRecognizer)gesture;
                CGPoint translation = pan.TranslationInView(Superview);
                panTransform = CGAffineTransform.Translate(CGAffineTransform.MakeIdentity(), translation.X, translation.Y);
            }

            Transform = CGAffineTransform.Multiply(CGAffineTransform.Multiply(scaleTransform, rotateTransform), panTransform);
        }
Esempio n. 8
0
        void startedGesture(UIGestureRecognizer gesture)
        {
            detachViewToWindow(true);
            UIPinchGestureRecognizer pinch = (gesture.GetType() == typeof(UIPinchGestureRecognizer)) ?
                                             (UIPinchGestureRecognizer)gesture : null;

            gesturesEnded = false;
            if (pinch != null)
            {
                scaleActive = true;
            }

            if (StackItemPinchPanRotateStarted != null)
            {
                StackItemPinchPanRotateStarted(this);
            }
        }