Repository navigation
Add animation to the Play/Stop button in Lottie Viewer. - #385
Conversation
This also fixes some little issues that I noticed during testing.
|
|
||
| void UncheckPlayStopButton() | ||
| { | ||
| //_playControlToggleVersion++; |
There was a problem hiding this comment.
There was a problem hiding this comment.
It's old code - it should go. It is the remnants of a hack.
In reply to: 522536396 [](ancestors = 522536396,522495975)
| d:DesignHeight="100" | ||
| d:DesignWidth="100"> | ||
|
|
||
| <ToggleButton |
There was a problem hiding this comment.
[](start = 17, length = 1)
Nit: extra space. #Closed
| so we remove them from UIA by marking them as "Raw" --> | ||
|
|
||
| <!--The transparent grid provides a target for clicking on that doesn't | ||
| change size when the animation for the button changes size.--> |
There was a problem hiding this comment.
Nit: add spaces by comment tags (consistent with the other comments). #Closed
There was a problem hiding this comment.
| <Grid Background="Transparent" Width="24" Height="24"> | ||
|
|
||
| <!-- This grid is animated to change size on hover. The AnimatedVisualPlayer cannot | ||
| have its size animated because it uses GetElementVisual for hosting the aimation. --> |
There was a problem hiding this comment.
aimation [](start = 89, length = 8)
"animation" #Closed
| SetAnimatedVisualColor(); | ||
| } | ||
|
|
||
| static void IsCheckedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((PlayStopButton)d).IsCheckedChanged(e); |
There was a problem hiding this comment.
IsCheckedChanged [](start = 20, length = 16)
Nit: OnIsCheckedChanged (or something similar)? With the function name starting with "Is", my mind defaults to thinking this is a predicate.
#Closed
| if (IsAnimationSupported) | ||
| { | ||
| // Play the segment that either goes from Play to Stop or Stop to Play. | ||
| var startProgress = isChecked ? 0.2501 : 0.75; |
There was a problem hiding this comment.
0.2501 [](start = 47, length = 7)
Could you add a comment explaining how these particular values correspond to the Play -> Stop or Stop -> Play animations? #Closed
| @@ -163,6 +163,15 @@ static IEnumerable<Visual> VisualsAndShapesToVisuals(CompositionContext context, | |||
| context.Issues.TimeStretchIsNotSupported(); | |||
| } | |||
There was a problem hiding this comment.
Not related to the PR, but should this check be before the IsHidden check? That way the issue will still be recorded even if the Layer is hidden. #Closed
| // LottieGen -Language CSharp -MinimumUapVersion 11 -InputFile LottieViewer_04_Playback.json | ||
| // | ||
| // Input file: | ||
| // LottieViewer_04_Playback.json (5185 bytes created 17:06-08:00 Nov 10 2020) |
There was a problem hiding this comment.
04 [](start = 25, length = 4)
Nit: if this is going to be a permanent file in the repo, could we remove the number from the .cs file name (and the .json file too if necessary)? #Closed
There was a problem hiding this comment.
This is a naming scheme coming from our designer. It's a bit ugly, but it will allow us to go back to the designers and describe which file it is without having to get them to adjust their naming scheme.
In reply to: 523170351 [](ancestors = 523170351)
54fca9a
This also fixes some little issues that I noticed during testing.