Exemplo n.º 1
0
        public ScrollDragController(
            ScrollActivityDelegate del          = null,
            DragStartDetails details            = null,
            VoidCallback onDragCanceled         = null,
            double?carriedVelocity              = null,
            double?motionStartDistanceThreshold = null
            )
        {
            D.assert(del != null);
            D.assert(details != null);
            D.assert(
                motionStartDistanceThreshold == null || motionStartDistanceThreshold > 0.0,
                "motionStartDistanceThreshold must be a positive number or null"
                );

            this._del                        = del;
            this._lastDetails                = details;
            this._retainMomentum             = carriedVelocity != null && carriedVelocity != 0.0;
            this._lastNonStationaryTimestamp = details.sourceTimeStamp;
            this._offsetSinceLastStop        = motionStartDistanceThreshold == null ? (double?)null : 0.0;

            this.onDragCanceled  = onDragCanceled;
            this.carriedVelocity = carriedVelocity;
            this.motionStartDistanceThreshold = motionStartDistanceThreshold;
        }
Exemplo n.º 2
0
 public DragScrollActivity(
     ScrollActivityDelegate del,
     ScrollDragController controller
     ) : base(del)
 {
     this._controller = controller;
 }
Exemplo n.º 3
0
 public HoldScrollActivity(
     ScrollActivityDelegate del  = null,
     VoidCallback onHoldCanceled = null
     ) : base(del)
 {
     this.onHoldCanceled = onHoldCanceled;
 }
Exemplo n.º 4
0
        public BallisticScrollActivity(
            ScrollActivityDelegate del,
            Simulation simulation,
            TickerProvider vsync
            ) : base(del)
        {
            this._controller = AnimationController.unbounded(
                debugLabel: this.GetType().ToString(),
                vsync: vsync
                );

            this._controller.addListener(this._tick);
            this._controller.animateWith(simulation).Then(() => this._end());
        }
Exemplo n.º 5
0
        public DrivenScrollActivity(
            ScrollActivityDelegate del,
            double from,
            double to,
            TimeSpan duration,
            Curve curve,
            TickerProvider vsync
            ) : base(del)
        {
            D.assert(duration > TimeSpan.Zero);
            D.assert(curve != null);

            this._completer  = new Promise();
            this._controller = AnimationController.unbounded(
                value: from,
                debugLabel: this.GetType().ToString(),
                vsync: vsync
                );
            this._controller.addListener(this._tick);
            this._controller.animateTo(to, duration: duration, curve: curve)
            .Then(() => this._end());
        }
Exemplo n.º 6
0
        public DrivenScrollActivity(
            ScrollActivityDelegate del,
            float from,
            float to,
            TimeSpan duration,
            Curve curve,
            TickerProvider vsync
            ) : base(del)
        {
            D.assert(duration > TimeSpan.Zero);
            D.assert(curve != null);

            _completer  = Completer.create();
            _controller = AnimationController.unbounded(
                value: from,
                debugLabel: GetType().ToString(),
                vsync: vsync
                );
            _controller.addListener(_tick);
            _controller.animateTo(to, duration: duration, curve: curve)
            .then(o => _end());
        }
Exemplo n.º 7
0
 public virtual void dispose()
 {
     this._del = null;
 }
Exemplo n.º 8
0
 public void updateDelegate(ScrollActivityDelegate value)
 {
     D.assert(this._del != value);
     this._del = value;
 }
Exemplo n.º 9
0
 public ScrollActivity(ScrollActivityDelegate del)
 {
     this._del = del;
 }
Exemplo n.º 10
0
 public IdleScrollActivity(ScrollActivityDelegate del) : base(del)
 {
 }
Exemplo n.º 11
0
 public virtual void dispose()
 {
     _del = null;
 }