public bool HandleTouchBegan(CGPoint point) { if (Note != null) { // if the note consumed touches Began, don't allow the UIScroll View to scroll. if (Note.TouchesBegan(point.ToPointF( )) == true) { UIScrollView.ScrollEnabled = false; return(true); } } return(false); }
public bool HitTest(CGPoint point) { if (Note != null) { AnimateTutorialScreen(false); // Base OS controls need to know whether to process & consume // input or pass it up to the higher level (us.) // We decide that based on whether the HitTest intersects any of our controls. // By returning true, it can know "Yes, this hits something we need to know about" // and it will result in us receiving TouchBegan if (Note.HitTest(point.ToPointF( )) == true) { return(true); } } return(false); }
public void iOSPanGesture(UIPanGestureRecognizer obj) { Rock.Mobile.Util.Debug.WriteLine("Panning"); // get the required data from the gesture and call our base function CGPoint currVelocity = obj.VelocityInView((UIView)ParentView); CGPoint deltaPan = new CGPoint(0, 0); PlatformCardCarousel.PanGestureState state = PlatformCardCarousel.PanGestureState.Began; switch (obj.State) { case UIGestureRecognizerState.Began: { PanLastPos = new PointF(0, 0); CommitCardPositions( ); state = PlatformCardCarousel.PanGestureState.Began; break; } case UIGestureRecognizerState.Changed: { CGPoint absolutePan = obj.TranslationInView((UIView)ParentView); deltaPan = new CGPoint(absolutePan.X - PanLastPos.X, 0); PanLastPos = absolutePan; state = PlatformCardCarousel.PanGestureState.Changed; break; } case UIGestureRecognizerState.Ended: { UpdateCardPositions( ); state = PlatformCardCarousel.PanGestureState.Ended; break; } } base.OnPanGesture(state, currVelocity.ToPointF( ), deltaPan.ToPointF( )); }
void AnimateToPanel(IMemberPanel fromPanel, CGPoint fromPanelEndPos, IMemberPanel toPanel) { ScrollView.SetContentOffset(CGPoint.Empty, true); // animate OUT the from panel (sending it to its endPos) SimpleAnimator_PointF fromPanelAnim = new SimpleAnimator_PointF(fromPanel.GetRootView( ).Layer.Position.ToPointF( ), fromPanelEndPos.ToPointF( ), .33f, delegate(float percent, object value) { fromPanel.GetRootView( ).Layer.Position = (PointF)value; }, null); fromPanelAnim.Start(SimpleAnimator.Style.CurveEaseOut); // animate IN the toPanel (which we know goes to 0,0 ) SimpleAnimator_PointF toPanelAnim = new SimpleAnimator_PointF(toPanel.GetRootView( ).Layer.Position.ToPointF( ), CGPoint.Empty.ToPointF( ), .33f, delegate(float percent, object value) { toPanel.GetRootView( ).Layer.Position = (PointF)value; }, delegate { ActivePanel = toPanel; ViewDidLayoutSubviews( ); }); toPanelAnim.Start(SimpleAnimator.Style.CurveEaseOut); }