Skip to content

Commit

Permalink
fix(animation): Fix transition animation not cancelled
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `VisualState.Setters` are now applied after `VisualTransition.Storyboard`
  • Loading branch information
dr1rrb committed Aug 17, 2021
1 parent 9cc3661 commit 144348c
Show file tree
Hide file tree
Showing 5 changed files with 205 additions and 163 deletions.
10 changes: 10 additions & 0 deletions src/Uno.UI/FeatureConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,16 @@ public static class UIElement
#endif
}

public static class VisualState
{
/// <summary>
/// When this is set, the <see cref="Windows.UI.Xaml.VisualState.Setters"/> will be applied synchronously when changing state,
/// unlike UWP which waits the for the end of the <see cref="VisualTransition.Storyboard"/> (if any) to apply them.
/// </summary>
/// <remarks>This flag is for backward compatibility with old versions of uno and should not be turned on.</remarks>
public static bool ApplySettersBeforeTransition { get; set; } = false;
}

public static class WebView
{
#if __ANDROID__
Expand Down
1 change: 1 addition & 0 deletions src/Uno.UI/UI/Xaml/Media/Animation/Storyboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ internal void TurnOverAnimationsTo(Storyboard storyboard)
((ITimeline)child).Stop();
}
}

State = TimelineState.Stopped;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Uno.UI/UI/Xaml/Media/Animation/Timeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public Timeline()
State = TimelineState.Stopped;
}

protected enum TimelineState
protected internal enum TimelineState
{
Active,
Filling,
Expand All @@ -46,7 +46,7 @@ protected string[] GetTraceProperties()
/// An internally-used property which is essentially equivalent to <see cref="Storyboard.GetCurrentState"/>, except that it
/// distinguishes <see cref="TimelineState.Active"/> from <see cref="TimelineState.Paused"/>.
/// </summary>
protected TimelineState State { get; set; }
protected internal TimelineState State { get; set; }

public TimeSpan? BeginTime
{
Expand Down
Loading

0 comments on commit 144348c

Please sign in to comment.