Skip to content

Add animation to the Play/Stop button in Lottie Viewer. - #385

Merged
simeoncran merged 7 commits into
masterfrom
AnimatePlayStartButton
Nov 13, 2020
Merged

simeoncran merged 7 commits into
masterfrom
AnimatePlayStartButton

Conversation

@simeoncran

Copy link
Copy Markdown
Contributor

This also fixes some little issues that I noticed during testing.

This also fixes some little issues that I noticed during testing.
@simeoncran
simeoncran requested a review from a team as a code owner November 12, 2020 20:51
Comment thread LottieViewer/MainPage.xaml.cs Outdated

void UncheckPlayStopButton()
{
//_playControlToggleVersion++;

@derobinsMSFT derobinsMSFT Nov 12, 2020 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove. #Closed

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't we want to uncomment this?


In reply to: 522495975 [](ancestors = 522495975)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's old code - it should go. It is the remnants of a hack.


In reply to: 522536396 [](ancestors = 522536396,522495975)

Comment thread LottieViewer/PlayStopButton.xaml Outdated
d:DesignHeight="100"
d:DesignWidth="100">

<ToggleButton

@derobinsMSFT derobinsMSFT Nov 12, 2020 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[](start = 17, length = 1)

Nit: extra space. #Closed

Comment thread LottieViewer/PlayStopButton.xaml Outdated
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.-->

@derobinsMSFT derobinsMSFT Nov 12, 2020 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: add spaces by comment tags (consistent with the other comments). #Closed

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: missed space at beginning of comment.


In reply to: 522497819 [](ancestors = 522497819)

Comment thread LottieViewer/PlayStopButton.xaml Outdated
<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. -->

@derobinsMSFT derobinsMSFT Nov 12, 2020 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aimation [](start = 89, length = 8)

"animation" #Closed

Comment thread LottieViewer/PlayStopButton.xaml.cs Outdated
SetAnimatedVisualColor();
}

static void IsCheckedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((PlayStopButton)d).IsCheckedChanged(e);

@derobinsMSFT derobinsMSFT Nov 12, 2020 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread LottieViewer/PlayStopButton.xaml.cs Outdated
if (IsAnimationSupported)
{
// Play the segment that either goes from Play to Stop or Stop to Play.
var startProgress = isChecked ? 0.2501 : 0.75;

@derobinsMSFT derobinsMSFT Nov 13, 2020 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();
}

@derobinsMSFT derobinsMSFT Nov 13, 2020 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

benwestprog
benwestprog previously approved these changes Nov 13, 2020

@benwestprog benwestprog left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

// 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)

@derobinsMSFT derobinsMSFT Nov 13, 2020 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

derobinsMSFT
derobinsMSFT previously approved these changes Nov 13, 2020

@derobinsMSFT derobinsMSFT left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

benwestprog
benwestprog previously approved these changes Nov 13, 2020

@benwestprog benwestprog left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@simeoncran
simeoncran dismissed stale reviews from benwestprog and derobinsMSFT via 54fca9a November 13, 2020 19:26

@derobinsMSFT derobinsMSFT left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@benwestprog benwestprog left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@simeoncran
simeoncran merged commit b51efec into master Nov 13, 2020
@delete-merged-branch
delete-merged-branch Bot deleted the AnimatePlayStartButton branch November 13, 2020 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants