Skip to content

Conversation

@hig-dev
Copy link

@hig-dev hig-dev commented Oct 21, 2016

This commit adds a way to modify the easing function used in animations using an optional enum type which is named "InterpolationType" (See issue #500). I tried to document the things right but I don't have much experience in documenting. So please be considerate. I only documented in code with the xml-tags. I hope that someone else can make the proper documentation in (https://github.com/Microsoft/UWPCommunityToolkit/tree/dev/docs) and modify the UWP Toolkit Samples app to show off the different easing functions.

Info: https://msdn.microsoft.com/en-us/windows/uwp/graphics/composition-animation#easing-functions

@dnfclas
Copy link

dnfclas commented Oct 21, 2016

Hi @hig-ag, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla2.dotnetfoundation.org.

TTYL, DNFBOT;

@deltakosh
Copy link
Contributor

deltakosh commented Oct 21, 2016

Hello there is no special skill to add a mention about your newly parameter in the doc (you already have written the text in the xmldoc btw)
Same for the sample app :)

@deltakosh
Copy link
Contributor

(beside that, great PR 👍 )

@ScottIsAFool
Copy link
Contributor

Build has failed on this, please run '.\build.ps1 UpdateHeaders' and commit the changes.

@deltakosh
Copy link
Contributor

Up? In order to get this one for 1.2 we need to merge it before end of next week

@deltakosh deltakosh added this to the v1.3 milestone Oct 31, 2016
/// </summary>
public static partial class AnimationExtensions
{
private static readonly EasingFunctionBase _defaultStoryboardEasingFunction = new CubicEase();
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about having a public default easing function that can be the default unless otherwise specified?

Copy link
Author

Choose a reason for hiding this comment

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

I think that it would be nice but that would maybe decrease the ease of use of the toolkit. In the current form the user doesn't have to know the internal things like EasingFunctionBase and so on.

Copy link
Contributor

Choose a reason for hiding this comment

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

You are right. I was thinking of having an EasingType (or InterpolationType depending on what you name it) that is public with a default value

return result;
}

private static EasingFunctionBase GetEasingFunction(InterpolationType interpolationType)
Copy link
Contributor

Choose a reason for hiding this comment

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

This only works for storyboards. Can you also add support for composition animations, like blur? You will most likely need to have two functions, one for composition and one for storyboards

Copy link
Author

Choose a reason for hiding this comment

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

The composition animations only support Cubic Bezier, and Step easing functions:
https://msdn.microsoft.com/en-us/windows/uwp/graphics/composition-animation#easing-functions

So the implementation is a little bit difficult.

Copy link
Contributor

Choose a reason for hiding this comment

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

@shenchauhan might be able to help with this

return result;
}

private static EasingFunctionBase GetEasingFunction(InterpolationType interpolationType)
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, does it make sense to make this function public? This way animation extensions outside of the toolkit can take advantage of it.

Copy link
Author

Choose a reason for hiding this comment

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

If that question is addressed to me: I really don't know.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it safe to make the functions public

Copy link
Contributor

Choose a reason for hiding this comment

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

agree with Nikola


[Fade Behavior Sample Page Source](https://github.com/Microsoft/UWPCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Fade)

## InterpolationType
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a question, why did you decide to go with InterplationType vs EasingType for the naming? EasingType seems more approachable, but that might be just me.

Copy link
Author

Choose a reason for hiding this comment

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

I thought that a linear interpolation can't be an easing function but I'm wrong. I think that both names are good but maybe EasingType is more suitable because the code and the documentation uses the word "easing". Note: I'm not a native English speaker.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's see if anyone else has an opinion, but I'm for changing it to easing type to make it more obvious what it is.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm for easing as well

@deltakosh
Copy link
Contributor

ping

@deltakosh
Copy link
Contributor

Up? Last call before I close the PR

@deltakosh
Copy link
Contributor

@nmetulev is that ok for you?

@hig-dev
Copy link
Author

hig-dev commented Jan 3, 2017

By the way, I signed the contribution license agreement but the label didn't disappear.

@deltakosh
Copy link
Contributor

Can you try it again?

@dnfclas
Copy link

dnfclas commented Jan 3, 2017

@hig-ag, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.

Thanks, DNFBOT;

@nmetulev
Copy link
Contributor

This looks great. The work still needs to be done to support Composition easing functions however, but I'm ok with that being a separate PR as long as we have it in the documentation that easing functions only work when using Storyboard mode.

@deltakosh deltakosh merged commit d81ab0d into CommunityToolkit:dev Jan 12, 2017
@deltakosh
Copy link
Contributor

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants