protected override bool _isFlingGesture(VelocityEstimate estimate) { float minVelocity = minFlingVelocity ?? Constants.kMinFlingVelocity; float minDistance = minFlingDistance ?? Constants.kTouchSlop; return(Mathf.Abs(estimate.pixelsPerSecond.dx) > minVelocity && Mathf.Abs(estimate.offset.dx) > minDistance); }
protected override bool _isFlingGesture(VelocityEstimate estimate) { double minVelocity = this.minFlingVelocity ?? Constants.kMinFlingVelocity; double minDistance = this.minFlingDistance ?? Constants.kTouchSlop; return(Math.Abs(estimate.pixelsPerSecond.dy) > minVelocity && Math.Abs(estimate.offset.dy) > minDistance); }
protected override bool _isFlingGesture(VelocityEstimate estimate) { float minVelocity = this.minFlingVelocity ?? Constants.kMinFlingVelocity; float minDistance = this.minFlingDistance ?? Constants.kTouchSlop; return(estimate.pixelsPerSecond.distanceSquared > minVelocity * minVelocity && estimate.offset.distanceSquared > minDistance * minDistance); }
public Velocity getVelocity() { VelocityEstimate estimate = getVelocityEstimate(); if (estimate == null || estimate.pixelsPerSecond == Offset.zero) { return(Velocity.zero); } return(new Velocity(pixelsPerSecond: estimate.pixelsPerSecond)); }
protected abstract bool _isFlingGesture(VelocityEstimate estimate);