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); } }
public override bool GestureRecognizerShouldBegin (UIGestureRecognizer gestureRecognizer) { if (gestureRecognizer.GetType () == typeof (UIPinchGestureRecognizer) && padTouch != null) return false; return true; }
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: () => { }); }
public bool gestureRecognizerShouldBegin(UIGestureRecognizer gestureRecognizer) { if (gestureRecognizer.GetType() == typeof(UIPinchGestureRecognizer)) { beginZoomScale = zoomScale; } return(true); }
public virtual bool ShouldReceiveTouch(UIGestureRecognizer recognizer, UITouch touch) { if ((recognizer.GetType() == typeof(UITapGestureRecognizer)) && (touch.View.GetType() == typeof(UIButton))) { return(false); } Alpha = 1; return(true); }
public override bool GestureRecognizerShouldBegin(UIGestureRecognizer gestureRecognizer) { if (gestureRecognizer.GetType() == typeof(UIPinchGestureRecognizer) && padTouch != null) { return(false); } return(true); }
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); }
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); } }