Browse Source

Fix unfinished clock type refactor.

pull/1715/head
Jeremy Koritzinsky 8 years ago
parent
commit
59cad1cf86
  1. 5
      src/Avalonia.Animation/Animatable.cs
  2. 4
      src/Avalonia.Animation/Animation.cs
  3. 4
      src/Avalonia.Animation/Animator`1.cs
  4. 5
      src/Avalonia.Animation/Clock.cs
  5. 4
      src/Avalonia.Animation/IAnimation.cs
  6. 2
      src/Avalonia.Animation/IAnimator.cs
  7. 2
      src/Avalonia.Animation/ITransition.cs
  8. 2
      src/Avalonia.Animation/Transition`1.cs

5
src/Avalonia.Animation/Animatable.cs

@ -14,7 +14,10 @@ namespace Avalonia.Animation
/// Base class for all animatable objects.
/// </summary>
public class Animatable : AvaloniaObject
{
{
public static readonly StyledProperty<IClock> ClockProperty =
AvaloniaProperty.Register<Animatable, IClock>(nameof(Clock), inherits: true);
/// <summary>
/// Defines the <see cref="PlayState"/> property.
/// </summary>

4
src/Avalonia.Animation/Animation.cs

@ -154,7 +154,7 @@ namespace Avalonia.Animation
}
/// <inheritdocs/>
public IDisposable Apply(Animatable control, Clock clock, IObservable<bool> match, Action onComplete)
public IDisposable Apply(Animatable control, IClock clock, IObservable<bool> match, Action onComplete)
{
var (animators, subscriptions) = InterpretKeyframes(control);
if (animators.Count == 1)
@ -185,7 +185,7 @@ namespace Avalonia.Animation
}
/// <inheritdocs/>
public Task RunAsync(Animatable control, Clock clock = null)
public Task RunAsync(Animatable control, IClock clock = null)
{
if (clock == null)
{

4
src/Avalonia.Animation/Animator`1.cs

@ -32,7 +32,7 @@ namespace Avalonia.Animation
}
/// <inheritdoc/>
public virtual IDisposable Apply(Animation animation, Animatable control, Clock clock, IObservable<bool> match, Action onComplete)
public virtual IDisposable Apply(Animation animation, Animatable control, IClock clock, IObservable<bool> match, Action onComplete)
{
if (!_isVerifiedAndConverted)
VerifyConvertKeyFrames();
@ -101,7 +101,7 @@ namespace Avalonia.Animation
/// <summary>
/// Runs the KeyFrames Animation.
/// </summary>
private IDisposable RunKeyFrames(Animation animation, Animatable control, Clock clock, Action onComplete)
private IDisposable RunKeyFrames(Animation animation, Animatable control, IClock clock, Action onComplete)
{
var instance = new AnimationInstance<T>(animation, control, this, clock, onComplete, DoInterpolation);
return control.Bind<T>((AvaloniaProperty<T>)Property, instance, BindingPriority.Animation);

5
src/Avalonia.Animation/Clock.cs

@ -11,6 +11,11 @@ namespace Avalonia.Animation
public static IClock GlobalClock => AvaloniaLocator.Current.GetService<IClock>();
private IDisposable _parentSubscription;
public Clock()
:this(GlobalClock)
{
}
public Clock(IClock parent)
{

4
src/Avalonia.Animation/IAnimation.cs

@ -11,11 +11,11 @@ namespace Avalonia.Animation
/// <summary>
/// Apply the animation to the specified control
/// </summary>
IDisposable Apply(Animatable control, Clock clock, IObservable<bool> match, Action onComplete = null);
IDisposable Apply(Animatable control, IClock clock, IObservable<bool> match, Action onComplete = null);
/// <summary>
/// Run the animation to the specified control
/// </summary>
Task RunAsync(Animatable control, Clock clock);
Task RunAsync(Animatable control, IClock clock);
}
}

2
src/Avalonia.Animation/IAnimator.cs

@ -16,6 +16,6 @@ namespace Avalonia.Animation
/// <summary>
/// Applies the current KeyFrame group to the specified control.
/// </summary>
IDisposable Apply(Animation animation, Animatable control, Clock clock, IObservable<bool> obsMatch, Action onComplete);
IDisposable Apply(Animation animation, Animatable control, IClock clock, IObservable<bool> obsMatch, Action onComplete);
}
}

2
src/Avalonia.Animation/ITransition.cs

@ -13,7 +13,7 @@ namespace Avalonia.Animation
/// <summary>
/// Applies the transition to the specified <see cref="Animatable"/>.
/// </summary>
IDisposable Apply(Animatable control, Clock clock, object oldValue, object newValue);
IDisposable Apply(Animatable control, IClock clock, object oldValue, object newValue);
/// <summary>
/// Gets the property to be animated.

2
src/Avalonia.Animation/Transition`1.cs

@ -49,7 +49,7 @@ namespace Avalonia.Animation
public abstract IObservable<T> DoTransition(IObservable<double> progress, T oldValue, T newValue);
/// <inheritdocs/>
public virtual IDisposable Apply(Animatable control, Clock clock, object oldValue, object newValue)
public virtual IDisposable Apply(Animatable control, IClock clock, object oldValue, object newValue)
{
var transition = DoTransition(new TransitionInstance(clock, Duration), (T)oldValue, (T)newValue);
return control.Bind<T>((AvaloniaProperty<T>)Property, transition, Data.BindingPriority.Animation);

Loading…
Cancel
Save