Exemple #1
0
        private void OnReleased(PointerInput input, double time)
        {
            if (!activeGestures.TryGetValue(input.InputId, out var existingGesture))
            {
                // Probably caught by UI, or the input was otherwise lost
                return;
            }

            activeGestures.Remove(input.InputId);
            existingGesture.SubmitPoint(input.Position, time);

            var swipeOrTap = false;

            if (IsValidSwipe(ref existingGesture))
            {
                Swiped?.Invoke(new SwipeInput(existingGesture));
                swipeOrTap = true;
            }

            if (IsValidTap(ref existingGesture))
            {
                Tapped?.Invoke(new TapInput(existingGesture));
                swipeOrTap = true;
            }

            if (!swipeOrTap)
            {
                DragFinished?.Invoke(new DragInput(existingGesture));
            }

            DebugInfo(existingGesture);
        }
Exemple #2
0
 private void EndDragging()
 {
     Transform = CGAffineTransform.MakeIdentity();
     Transform.Scale((nfloat)3, (nfloat)3);
     UIView.Animate(duration: 0.3, animation: () =>
     {
         Layer.Opacity = 0.8f;
         Transform.Scale((nfloat)1, (nfloat)1);
     }, completion: null);
     DragFinished.Invoke(this, null);
 }