浏览代码

Merge branch 'match_flutter12' into yczhang

/main
Yuncong Zhang 5 年前
当前提交
f8d2ba1d
共有 6 个文件被更改,包括 141 次插入22 次删除
  1. 61
      Runtime/animation/animation_controller.cs
  2. 54
      Runtime/animation/curves.cs
  3. 30
      Runtime/animation/listener_helpers.mixin.gen.cs
  4. 12
      Runtime/animation/listener_helpers.mixin.njk
  5. 4
      Runtime/foundation/node.mixin.gen.cs
  6. 2
      Runtime/rendering/object.mixin.gen.cs

61
Runtime/animation/animation_controller.cs


return true;
});
D.assert(
this._ticker != null,
"AnimationController.forward() called after AnimationController.dispose()\n" +
"AnimationController methods should not be used after calling dispose."
);
this._direction = _AnimationDirection.forward;
if (from != null) {
this.setValue(from.Value);

return true;
});
D.assert(
this._ticker != null,
"AnimationController.reverse() called after AnimationController.dispose()\n" +
"AnimationController methods should not be used after calling dispose."
);
this._direction = _AnimationDirection.reverse;
if (from != null) {
this.setValue(from.Value);

}
public TickerFuture animateTo(float target, TimeSpan? duration = null, Curve curve = null) {
D.assert(
this._ticker != null,
"AnimationController.animateTo() called after AnimationController.dispose()\n" +
"AnimationController methods should not be used after calling dispose."
);
TickerFuture animateBack(float target, TimeSpan? duration, Curve curve = null) {
D.assert(
this._ticker != null,
"AnimationController.animateBack() called after AnimationController.dispose()\n" +
"AnimationController methods should not be used after calling dispose."
);
curve = curve ?? Curves.linear;
this._direction = _AnimationDirection.reverse;
return this._animateToInternal(target, duration, curve);
}
TickerFuture _animateToInternal(float target, TimeSpan? duration = null, Curve curve = null) {
curve = curve ?? Curves.linear;

new _InterpolationSimulation(this._value, target, simulationDuration.Value, curve));
}
public TickerFuture repeat(float? min = null, float? max = null, TimeSpan? period = null) {
public TickerFuture repeat(float? min = null, float? max = null, bool reverse = false, TimeSpan? period = null) {
min = min ?? this.lowerBound;
max = max ?? this.upperBound;
period = period ?? this.duration;

return true;
});
return this.animateWith(new _RepeatingSimulation(min.Value, max.Value, period.Value));
D.assert(max >= min);
D.assert(max <= this.upperBound && min >= this.lowerBound);
return this.animateWith(new _RepeatingSimulation(this._value, min.Value, max.Value, reverse, period.Value));
}
public TickerFuture fling(float velocity = 1.0f) {

public TickerFuture animateWith(Simulation simulation) {
D.assert(
this._ticker != null,
"AnimationController.animateWith() called after AnimationController.dispose()\n" +
"AnimationController methods should not be used after calling dispose."
);
this.stop();
return this._startSimulation(simulation);
}

}
public void stop(bool canceled = true) {
D.assert(
this._ticker != null,
"AnimationController.stop() called after AnimationController.dispose()\n" +
"AnimationController methods should not be used after calling dispose."
);
this._simulation = null;
this._lastElapsedDuration = null;
this._ticker.stop(canceled: canceled);

}
class _RepeatingSimulation : Simulation {
internal _RepeatingSimulation(float min, float max, TimeSpan period) {
internal _RepeatingSimulation(float initialValue, float min, float max, bool reverse, TimeSpan period) {
this._initialT = (max == min) ? 0.0f : (initialValue / (max - min)) * (period.Ticks / TimeSpan.TicksPerSecond);
this._reverse = reverse;
D.assert(this._initialT >= 0.0f);
readonly bool _reverse;
readonly float _initialT;
float t = (timeInSeconds / this._periodInSeconds) % 1.0f;
return MathUtils.lerpFloat(this._min, this._max, t);
float totalTimeInSeconds = timeInSeconds + this._initialT;
float t = (totalTimeInSeconds / this._periodInSeconds) % 1.0f;
bool _isPlayingReverse = ((int)(totalTimeInSeconds / this._periodInSeconds)) % 2 == 1;
if (this._reverse && _isPlayingReverse) {
return MathUtils.lerpFloat(this._max, this._min, t);
} else {
return MathUtils.lerpFloat(this._min, this._max, t);
}
}
public override float dx(float timeInSeconds) {

54
Runtime/animation/curves.cs


public static readonly Curve linear = new _Linear();
public static readonly Curve decelerate = new _DecelerateCurve();
public static readonly Cubic fastLinearToSlowEaseIn = new Cubic(0.18f, 1.0f, 0.04f, 1.0f);
public static readonly Cubic easeInToLinear = new Cubic(0.67f, 0.03f, 0.65f, 0.09f);
public static readonly Cubic easeInSine = new Cubic(0.47f, 0, 0.745f, 0.715f);
public static readonly Cubic easeInQuad = new Cubic(0.55f, 0.085f, 0.68f, 0.53f);
public static readonly Cubic easeInCubic = new Cubic(0.55f, 0.055f, 0.675f, 0.19f);
public static readonly Cubic easeInQuart = new Cubic(0.895f, 0.03f, 0.685f, 0.22f);
public static readonly Cubic easeInQuint = new Cubic(0.755f, 0.05f, 0.855f, 0.06f);
public static readonly Cubic easeInExpo = new Cubic(0.95f, 0.05f, 0.795f, 0.035f);
public static readonly Cubic easeInCirc = new Cubic(0.6f, 0.04f, 0.98f, 0.335f);
public static readonly Cubic easeInBack = new Cubic(0.6f, -0.28f, 0.735f, 0.045f);
public static readonly Cubic linearToEaseOut = new Cubic(0.35f, 0.91f, 0.33f, 0.97f);
public static readonly Cubic easeOutSine = new Cubic(0.39f, 0.575f, 0.565f, 1.0f);
public static readonly Cubic easeOutQuad = new Cubic(0.25f, 0.46f, 0.45f, 0.94f);
public static readonly Cubic easeOutCubic = new Cubic(0.215f, 0.61f, 0.355f, 1.0f);
public static readonly Cubic easeOutQuart = new Cubic(0.165f, 0.84f, 0.44f, 1.0f);
public static readonly Cubic easeOutQuint = new Cubic(0.23f, 1.0f, 0.32f, 1.0f);
public static readonly Cubic easeOutExpo = new Cubic(0.19f, 1.0f, 0.22f, 1.0f);
public static readonly Cubic easeOutCirc = new Cubic(0.075f, 0.82f, 0.165f, 1.0f);
public static readonly Cubic easeOutBack = new Cubic(0.175f, 0.885f, 0.32f, 1.275f);
public static readonly Cubic easeInOutSine = new Cubic(0.445f, 0.05f, 0.55f, 0.95f);
public static readonly Cubic easeInOutQuad = new Cubic(0.455f, 0.03f, 0.515f, 0.955f);
public static readonly Cubic easeInOutCubic = new Cubic(0.645f, 0.045f, 0.355f, 1.0f);
public static readonly Cubic easeInOutQuart = new Cubic(0.77f, 0, 0.175f, 1.0f);
public static readonly Cubic easeInOutQuint = new Cubic(0.86f, 0, 0.07f, 1.0f);
public static readonly Cubic easeInOutExpo = new Cubic(1.0f, 0, 0, 1.0f);
public static readonly Cubic easeInOutCirc = new Cubic(0.785f, 0.135f, 0.15f, 0.86f);
public static readonly Cubic easeInOutBack = new Cubic(0.68f, -0.55f, 0.265f, 1.55f);
public static readonly Curve fastOutSlowIn = new Cubic(0.4f, 0.0f, 0.2f, 1.0f);

30
Runtime/animation/listener_helpers.mixin.gen.cs


}
public override void removeListener(VoidCallback listener) {
this._listeners.Remove(listener);
this.didUnregisterListener();
bool removed = this._listeners.Remove(listener);
if(removed) {
this.didUnregisterListener();
}
}
public void notifyListeners() {

}
public override void removeListener(VoidCallback listener) {
this._listeners.Remove(listener);
this.didUnregisterListener();
bool removed = this._listeners.Remove(listener);
if(removed) {
this.didUnregisterListener();
}
}
public void notifyListeners() {

}
public override void removeStatusListener(AnimationStatusListener listener) {
this._statusListeners.Remove(listener);
this.didUnregisterListener();
bool removed = this._statusListeners.Remove(listener);
if(removed) {
this.didUnregisterListener();
}
}
public void notifyStatusListeners(AnimationStatus status) {

}
public override void removeStatusListener(AnimationStatusListener listener) {
this._statusListeners.Remove(listener);
this.didUnregisterListener();
bool removed = this._statusListeners.Remove(listener);
if(removed) {
this.didUnregisterListener();
}
}
public void notifyStatusListeners(AnimationStatus status) {

}
public override void removeStatusListener(AnimationStatusListener listener) {
this._statusListeners.Remove(listener);
this.didUnregisterListener();
bool removed = this._statusListeners.Remove(listener);
if(removed) {
this.didUnregisterListener();
}
}
public void notifyStatusListeners(AnimationStatus status) {

12
Runtime/animation/listener_helpers.mixin.njk


}
public override void removeListener(VoidCallback listener) {
this._listeners.Remove(listener);
this.didUnregisterListener();
bool removed = this._listeners.Remove(listener);
if(removed) {
this.didUnregisterListener();
}
}
public void notifyListeners() {

}
public override void removeStatusListener(AnimationStatusListener listener) {
this._statusListeners.Remove(listener);
this.didUnregisterListener();
bool removed = this._statusListeners.Remove(listener);
if(removed) {
this.didUnregisterListener();
}
}
public void notifyStatusListeners(AnimationStatus status) {

4
Runtime/foundation/node.mixin.gen.cs


static readonly Dictionary<_DependencyList, WeakReference> _canonicalObjects =
new Dictionary<_DependencyList, WeakReference>();
public bool pureWidget { get; set; } // pure = false, if canonicalEquals should not be used.
public bool pureWidget { get; set; } // if canonicalEquals should not be used.
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj)) {

2
Runtime/rendering/object.mixin.gen.cs


get { return this._childCount; }
}
public new bool debugValidateChild(RenderObject child) {
public bool debugValidateChild(RenderObject child) {
D.assert(() => {
if (!(child is ChildType)) {
throw new UIWidgetsError(

正在加载...
取消
保存