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

[DRAFT] Add LottieIsland and LottieWinRT for frameworkless or native applications #557

Open
wants to merge 45 commits into
base: main
Choose a base branch
from

Conversation

getrou
Copy link
Contributor

@getrou getrou commented Apr 22, 2024

No description provided.

getrou and others added 30 commits March 15, 2024 13:17
…ad to build a custom lottie package and copy binaries into output folder manually since VS did not do it correctly. Will update build files to do this copy in the future.
SimpleIslandApp now calls into C# JSON loader
…isualSourceFrameworkless in order to avoid confusion with existing Microsoft.UI.Xaml.Controls interface
…#, packages not set up correctly for native yet)
…='x86' /p:Configuration='Release' /target:'SimpleLottieIslandApp'
Copy link

@jeffstall jeffstall left a comment

Choose a reason for hiding this comment

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

Please address items and update.

LottieIsland/LottieContentIsland.cpp Outdated Show resolved Hide resolved
LottieWinRT/AnimatedVisual.cs Outdated Show resolved Hide resolved
Lottie-Windows.sln Outdated Show resolved Hide resolved
{C505CD2D-5D26-42EE-8FAA-41BB784821EF}.BETA|Any CPU.ActiveCfg = Debug|Any CPU
{C505CD2D-5D26-42EE-8FAA-41BB784821EF}.BETA|Any CPU.Build.0 = Debug|Any CPU
{C505CD2D-5D26-42EE-8FAA-41BB784821EF}.BETA|ARM.ActiveCfg = Debug|Any CPU
{C505CD2D-5D26-42EE-8FAA-41BB784821EF}.BETA|ARM.Build.0 = Debug|Any CPU

Choose a reason for hiding this comment

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

What's BETA? Is this a new config? How does this work with Debug and Release?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure, it was in the solution before I came along, and the BETA entries for the new projects were added automatically.

@@ -0,0 +1,466 @@
// Copyright (c) Microsoft Corporation.

Choose a reason for hiding this comment

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

We'll change this later to use AppWindow and remove a lot of unnecessary code.

SimpleLottieIslandApp/package.appxmanifest Outdated Show resolved Hide resolved
source/Lottie/LottieVisualSource.cs Outdated Show resolved Hide resolved
source/Lottie/LottieVisualSourceFrameworkless.cs Outdated Show resolved Hide resolved
source/Lottie/LottieVisualSourceFrameworkless.cs Outdated Show resolved Hide resolved
Copy link
Member

@michael-hawker michael-hawker left a comment

Choose a reason for hiding this comment

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

Saw some concerns with namespaces and class names, so figured I'd provide some input in that space here before this gets merged/released.

Also, have some potential concerns around breaks/ramifications to the XAML layer in the base LottieVisualSource signature change.

Comment on lines +12 to +13
<RootNamespace>CommunityToolkit.WinAppSDK.LottieIsland</RootNamespace>
<AssemblyName>CommunityToolkit.WinAppSDK.LottieIsland</AssemblyName>
Copy link
Member

Choose a reason for hiding this comment

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

Most other NuGet packages are using the full WindowsAppSDK over abbreviating it. I'd suggest we use the expanded.

/// An <see cref="IAnimatedVisualSource"/> for a Lottie composition. This allows
/// a Lottie to be specified as the source for a <see cref="AnimatedVisualPlayer"/>.
/// </summary>
public sealed class LottieVisualSourceWinUI : DependencyObject, IDynamicAnimatedVisualSource
Copy link
Member

Choose a reason for hiding this comment

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

Having WinUI in the class name seems really odd here as it's already part of the namespace. Do we need an alternate as LottieVisualSource is already used in the base library?

Will they ever both need to be used together though (if they're in different namespaces)?

I'm not completely looped into how this all works, but just trying to provide some general guidance when I saw the namespace/class names come up in the discussion.

Comment on lines +9 to +10
<RootNamespace>CommunityToolkit.WinAppSDK.LottieWinRT</RootNamespace>
<AssemblyName>CommunityToolkit.WinAppSDK.LottieWinRT</AssemblyName>
Copy link
Member

Choose a reason for hiding this comment

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

Having 'WinRT' seems a bit odd for the package/namespace/classes (as most packages/folks still associate WinRT with Win 8 outside of our more recent usage for CppWinRT/CsWinRT), as 'UWP' kind of became an umbrella for everything in the end in-between when we moved to Win 10.

Should this just be CommunityToolkit.WindowsAppSDK.Lottie instead?

Some more details in the PR description on the hierarchy and structure and what each package provides, what it does, and where it'd be used by an end-developer would help here.


namespace CommunityToolkit.WinAppSDK.LottieWinRT
{
public sealed class LottieVisualSourceWinRT
Copy link
Member

Choose a reason for hiding this comment

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

Again, odd to have WinRT in the namespace and the class here. Would be good to have some XML comments and better understand which scenarios each of these sources needs to be used in, then might be able to help suggest alternative names.

using Windows.Storage;
using Windows.Storage.Streams;

namespace CommunityToolkit.WinUI.Lottie.Controls
Copy link
Member

Choose a reason for hiding this comment

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

Since we're adding new code, would be good to start switching to file-scoped namespaces and reduce indentation.

/// A class for a Lottie composition. This allows
/// a Lottie to be specified as source of a <see cref="IAnimatedVisual"/>.
/// </summary>
public sealed class LottieVisualSource
Copy link
Member

Choose a reason for hiding this comment

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

Why is this different in this case? Won't the dependency properties break if it's not a DependencyObject?

Is this to avoid loading XAML to use elsewhere, but then doesn't that break XAML scenarios?

Does that mean we need a new base class that provides the core functionality and not tied to XAML that then the XAML based pieces wrap here?

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