Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement feature AnimatedVisualPlayer #130

Conversation

improbabilityphysics
Copy link
Contributor

@improbabilityphysics improbabilityphysics commented Dec 22, 2018

Full description of AVP(cited from simeon's words):

"The AnimatedVisualPlayer is a XAML FrameworkElement that hosts and controls animated Windows.UI.Composition content. This content is typically Lotties (see https://airbnb.design/lottie/) but can be anything that conforms to the IAnimatedVisualSource interface. The player is most typically used to display and control micro-animations within UI, for example an animated icon on a button.

To use the AnimatedVisualPlayer with Lottie files, see https://github.com/windows-toolkit/Lottie-Windows."

In this PR, I have made following changes:

  1. merge AVP changes from winui_rs5
  2. use USE_INSIDER_SDK for 19H1 preview because RS5 SDK has IClosable MIDLRT compiling error.
  3. use USE_INTERNAL_SDK macro for massaging code because some API code is not exposed to insider preview yet.
  4. renaming Deps to MUX related to namingspace
  5. ASSERT macro modification.
  6. use codegen for dependency properties of AVP.

@improbabilityphysics
Copy link
Contributor Author

@simeoncran @jevansaks @Microsoft/microsoft-ui-xaml-codereviews ping...

@jevansaks
Copy link
Member

Can you fix the title of this PR to be the newly added feature with a full description about the feature? There's no context for this feature on the GitHub.

@improbabilityphysics improbabilityphysics changed the title [AimatedVisualPlayer] Merge AVP changes from winui_rs5 to master [newly added feature: AimatedVisualPlayer] Merge AVP changes from winui_rs5 to master Jan 11, 2019
Copy link
Member

@jevansaks jevansaks left a comment

Choose a reason for hiding this comment

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

Added comments.

@jevansaks jevansaks changed the title [newly added feature: AimatedVisualPlayer] Merge AVP changes from winui_rs5 to master Implement feature AnimatedVisualPlayer Jan 14, 2019
Copy link
Member

@jevansaks jevansaks left a comment

Choose a reason for hiding this comment

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

Approved assuming that the open comments are resolved.

@improbabilityphysics improbabilityphysics force-pushed the user/yongql/merge_animatedvisualplayer_from_winui_rs5_github branch 3 times, most recently from fb2d33b to 7706210 Compare January 22, 2019 21:31
@improbabilityphysics improbabilityphysics force-pushed the user/yongql/merge_animatedvisualplayer_from_winui_rs5_github branch from d9e7681 to c8f53d2 Compare January 26, 2019 00:05
@improbabilityphysics improbabilityphysics force-pushed the user/yongql/merge_animatedvisualplayer_from_winui_rs5_github branch from 5a2ad70 to cc89861 Compare January 28, 2019 23:30
@licanhua
Copy link
Contributor

I expect you made change to this file too


Refers to: dev/dll/Microsoft.UI.Xaml.vcxproj:670 in cc89861. [](commit_id = cc89861, deletion_comment = False)

@clarkezone
Copy link

The latest preview SDK is 18323.. this PR is still targeting 18312

@jevansaks
Copy link
Member

The latest preview SDK is 18323.. this PR is still targeting 18312

We can retarget in a subsequent change -- until the SDK for this release is finalized there's not too much reason to keep moving insider SDKs. You can use the Install-WindowsSdkISO.ps1 in the repo to install the archived ones.

Merged PR 2627158: AnimatedVisualPlayer: Fix bug that AnimatedVisualPlayer does not accept hit-testing for pointer event handler

The change is set a transparent background for AnimatedVisualPlayer(looks like UIElement, Element content panel in real) in ::OnLoaded. Element content panel has visual tree underneath for rendering. And a xaml element background child under this panel for hit-testing.

Related work items: #19685745

merge PR 2638219: AnimatedVisualPlayer: Fix IsPlaying not working issue

Merged PR 2644493: fix keyframe crossing bounds scenario issue

This issue is caused by in-correct split crossing bounds key frame animation into two. when [fromKeyframe...toKeyframe] range is defined as [0.35...0], it is supposed to have two key frame animations, one is [0.35...1], another one is nothing. However, we have another one [1+10e-7, 0]. clearly 1 + 10e-7 is greater than 1 and crash the app.

The fix is to check [fromKeyframe...toKeyframe] range value, when fromKeyframe > toKeyframe, but toKeyframe == 0, then simply correct toKeyframe to 1 to avoid additional key frame animation.

Also, when fromKeyframe == 1, then simply correct fromKeyframe to 0 to save additional key frame animation as well.

Related work items: #19757860

merge PR 2665041: [Lottie][Ship-Blocker] fix reverse negative playbackrate animation not working bug.

merge PR 2670894: [Lottie][Ship-Blocker]Adding missing AVP bug fix test in WinUI

correct some configuration or namespace missing issues.

delete unrelated files.

use codegen for dependency properties in AnimatedVisualPlayer.

Removed experimental flags for AVP and abandoned other duplicate PR. Set the expected default values for dependency properties initialization in *idl file of AVP. Added build support for UseInsiderSDK. Added/corrected telemetry instrumenting code.

Added callback registration macro for dependency properties in .idl if necessary. Automated test has being run and passed for AVP accessibility tests.
…more using USE_INTERNAL_SDK, auto test running AVP passed in nebula VM.
…lated. Correct Win2D 1.23.0 with Win2D 1.22.0 in WUXTestApp solution.
…d redundante header includes in AnimatedVisualPlayer.h
…ion in RS1|2|3 where RS4 API ICompositor5 QI failed and crash taef test app.
…void atlas test failures in RS3_desktop test run.
…for commandbarflyout and slider/buttonInteraction test to filter them out.
@improbabilityphysics improbabilityphysics force-pushed the user/yongql/merge_animatedvisualplayer_from_winui_rs5_github branch from cf437a9 to d687630 Compare January 31, 2019 00:01
@improbabilityphysics improbabilityphysics merged commit 4b48ecf into master Jan 31, 2019
@improbabilityphysics improbabilityphysics deleted the user/yongql/merge_animatedvisualplayer_from_winui_rs5_github branch January 31, 2019 01:57
@msft-github-bot
Copy link
Collaborator

🎉Microsoft.UI.Xaml v2.1.190131001-prerelease has been released which incorporates this pull request.:tada:

Handy links:

StephenLPeters pushed a commit that referenced this pull request Feb 9, 2019
* merge AnimatedVisualPlayer change from winui_rs5 to master in GitHub.

Merged PR 2627158: AnimatedVisualPlayer: Fix bug that AnimatedVisualPlayer does not accept hit-testing for pointer event handler

The change is set a transparent background for AnimatedVisualPlayer(looks like UIElement, Element content panel in real) in ::OnLoaded. Element content panel has visual tree underneath for rendering. And a xaml element background child under this panel for hit-testing.

Related work items: #19685745

merge PR 2638219: AnimatedVisualPlayer: Fix IsPlaying not working issue

Merged PR 2644493: fix keyframe crossing bounds scenario issue

This issue is caused by in-correct split crossing bounds key frame animation into two. when [fromKeyframe...toKeyframe] range is defined as [0.35...0], it is supposed to have two key frame animations, one is [0.35...1], another one is nothing. However, we have another one [1+10e-7, 0]. clearly 1 + 10e-7 is greater than 1 and crash the app.

The fix is to check [fromKeyframe...toKeyframe] range value, when fromKeyframe > toKeyframe, but toKeyframe == 0, then simply correct toKeyframe to 1 to avoid additional key frame animation.

Also, when fromKeyframe == 1, then simply correct fromKeyframe to 0 to save additional key frame animation as well.

Related work items: #19757860

merge PR 2665041: [Lottie][Ship-Blocker] fix reverse negative playbackrate animation not working bug.

merge PR 2670894: [Lottie][Ship-Blocker]Adding missing AVP bug fix test in WinUI

correct some configuration or namespace missing issues.

delete unrelated files.

use codegen for dependency properties in AnimatedVisualPlayer.

Removed experimental flags for AVP and abandoned other duplicate PR. Set the expected default values for dependency properties initialization in *idl file of AVP. Added build support for UseInsiderSDK. Added/corrected telemetry instrumenting code.

Added callback registration macro for dependency properties in .idl if necessary. Automated test has being run and passed for AVP accessibility tests.

* add AnimatedVisualPlayer and its test items into solution. massaging more using USE_INTERNAL_SDK, auto test running AVP passed in nebula VM.

* restore to USE_INSIDER_SDK because of upgrading to SDK 18312

* upgrade RunTests/Build SDK version to insider SDK 18312.

* Replace USE_INSIDER_SDK with USE_INTERNAL_SDK for CommandBarFlyout related. Correct Win2D 1.23.0 with Win2D 1.22.0 in WUXTestApp solution.

* Removed Win2D.uwp package reference by updating LOttieLogo.cs. Removed redundante header includes in AnimatedVisualPlayer.h

* Add CompositionObject into Windows.UI.Composition namesapce in XamlMetadataProviderWindowsCodeGen.tt

* remove Windows.Foundation.Metadata direction in AnimatedVisualPlayerTests.cs for windows build.

* remove AVP from windows build.

* remove AVP from windows build in XamlMetadataProviderGenerated.tt

* add os version check in AVP::UpdateContent to avoid source instantiation in RS1|2|3 where RS4 API ICompositor5 QI failed and crash taef test app.

* remove hack of commenting out return null for OS check in TryCreateAnimatedVisual

* More agressively to turn off USE_INSIDER_SDK to USE_INTERNAL_SDK to avoid atlas test failures in RS3_desktop test run.

* fix merge conflicts. in TreeViewAutomationPeers.idl

* more massaging from USE_INSIDER_SDK to USE_INTERNAL_SDK to maks ATLAS test run happy in RS3.

* Keep USE_INSIDER_SDK consistent with recent master. USE_INTERNAL_SDK for commandbarflyout and slider/buttonInteraction test to filter them out.

* switch all USE_INSIDER_SDK|UseInsiderSDK code to USE_INTERNAL_SDK|UseInternalSDK except AVP

* work around to fix rs3 xbf issue with SDK 18312. turn USE_INSIDER_SDK to USE_INTERNAL_SDK for razzle.

* Rmove Any CPU configurations from MUXControls.sln

* switch some USE_INSTERNAL_SDK to USE_INSIDE_SDK. xbf work around for RS4 and RS5.

* Resolve this pointer captured in m_batch; fix source revoker issue; other issue; add prefxied.
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.

6 participants