public override IPromise animateTo(float to,
                                           TimeSpan duration,
                                           Curve curve
                                           )
        {
            if (PhysicsUtils.nearEqual(to, this.pixels, this.physics.tolerance.distance))
            {
                this.jumpTo(to);
                return(Promise.Resolved());
            }

            DrivenScrollActivity activity = new DrivenScrollActivity(
                this,
                from: this.pixels,
                to: to,
                duration: duration,
                curve: curve,
                vsync: this.context.vsync
                );

            this.beginActivity(activity);
            return(activity.done);
        }
Пример #2
0
        public override Future animateTo(
            float to,
            TimeSpan duration,
            Curve curve
            )
        {
            if (PhysicsUtils.nearEqual(to, pixels, physics.tolerance.distance))
            {
                jumpTo(to);
                return(Future.value());
            }

            DrivenScrollActivity activity = new DrivenScrollActivity(
                this,
                from: pixels,
                to: to,
                duration: duration,
                curve: curve,
                vsync: context.vsync
                );

            beginActivity(activity);
            return(activity.done);
        }