void EndInteraction(bool success) { if (context == null) { HasActiveInteraction = false; return; } if (success && (transitionLayout.TransitionProgress > 0.5f)) { collectionView.FinishInteractiveTransition(); context.FinishInteractiveTransition(); } else { collectionView.CancelInteractiveTransition(); context.CancelInteractiveTransition(); } }
// called by our pinch gesture recognizer when the gesture has finished or cancelled, which // in turn is responsible for finishing or cancelling the transition. void EndInteraction(bool success) { if (context == null) { HasActiveInteraction = false; } // allow for the transition to finish when it's progress has started as a threshold of 10%, // if you want to require the pinch gesture with a wider threshold, change it it a value closer to 1.0 // else if ((transitionLayout.TransitionProgress > 0.1f) && success) { collectionView.FinishInteractiveTransition(); context.FinishInteractiveTransition(); } else { collectionView.CancelInteractiveTransition(); context.CancelInteractiveTransition(); } }