AdjustForSwipeFixCompleted() public method

public AdjustForSwipeFixCompleted ( double targetWidth ) : void
targetWidth double
return void
Beispiel #1
0
        public void SwipeTo(SwipeDirection direction, SwipeConfig config, bool animated)
        {
            var targetWidth = config.TriggerActionTargetWidth;
            var targetX     = config.Direction == SwipeDirection.Left ? targetWidth : -targetWidth;

            config.AdjustForSwipeToFixStarted();
            var clipScaleX = targetWidth;

            if (animated)
            {
                DisplayAnimation(config, targetX, clipScaleX, () =>
                {
                    config.AdjustForSwipeFixCompleted(targetWidth);
                });
            }
            else
            {
                config.MainTransform.X = targetX;
                config.AdjustForSwipeFixCompleted(targetWidth);
            }
        }
Beispiel #2
0
        public override void ActionTrigger(SwipeDirection direction, SwipeConfig config, AnimationCallback beginTriggerCallback, Action triggerCompleteCallback)
        {
            var targetWidth = config.TriggerActionTargetWidth;
            var targetX     = config.Direction == SwipeDirection.Left ? targetWidth : -targetWidth;
            var clipScaleX  = targetWidth / config.CurrentSwipeWidth;

            beginTriggerCallback?.Invoke(config.EasingFunc, targetX, config.Duration);

            DisplayAnimation(config, targetX, clipScaleX, () =>
            {
                triggerCompleteCallback?.Invoke();
                config.AdjustForSwipeFixCompleted(targetWidth);
            });
        }
        public void SwipeTo(SwipeDirection direction, SwipeConfig config, bool animated)
        {
            var targetWidth = config.TriggerActionTargetWidth;
            var targetX = config.Direction == SwipeDirection.Left ? targetWidth : -targetWidth;
            config.AdjustForSwipeToFixStarted();
            var clipScaleX = targetWidth;

            if (animated)
            {
                DisplayAnimation(config, targetX, clipScaleX, () =>
                {
                    config.AdjustForSwipeFixCompleted(targetWidth);
                });
            }
            else
            {
                config.MainTransform.X = targetX;
                config.AdjustForSwipeFixCompleted(targetWidth);
            }
        }
        public override void ActionTrigger(SwipeDirection direction, SwipeConfig config, AnimationCallback beginTriggerCallback, Action triggerCompleteCallback)
        {
            var targetWidth = config.TriggerActionTargetWidth;
            var targetX = config.Direction == SwipeDirection.Left ? targetWidth : -targetWidth;
            var clipScaleX = targetWidth / config.CurrentSwipeWidth;

            beginTriggerCallback?.Invoke(config.EasingFunc, targetX, config.Duration);

            DisplayAnimation(config, targetX, clipScaleX, ()=>
            {
                triggerCompleteCallback?.Invoke();
                config.AdjustForSwipeFixCompleted(targetWidth);
            });
        }