Skip to content

Commit 7a338f6

Browse files
authored
Add Lottie-Windows-UwpNET.csproj (#572)
* add Lottie-Windows-UwpNET.csproj which targets .NET9 + system XAML and will be bundled together with Lottie-Windows-UWP * remove <GeneratePackageOnBuild> from csproj * comment out signing step for now
1 parent 2e8ca56 commit 7a338f6

File tree

13 files changed

+176
-59
lines changed

13 files changed

+176
-59
lines changed

Lottie-Windows.sln

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lottie-Windows-WinUI3", "Lo
171171
EndProject
172172
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LottieSamples", "LottieSamples\LottieSamples.csproj", "{6AB50ED0-6273-4919-9ADE-50195664EF15}"
173173
EndProject
174+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lottie-Windows-UwpNET", "Lottie-Windows\Lottie-Windows-UwpNET\Lottie-Windows-UwpNET.csproj", "{FA1977D8-5C6F-DF3A-0926-C12A1A415024}"
175+
EndProject
174176
Global
175177
GlobalSection(SolutionConfigurationPlatforms) = preSolution
176178
BETA|Any CPU = BETA|Any CPU
@@ -615,6 +617,36 @@ Global
615617
{6AB50ED0-6273-4919-9ADE-50195664EF15}.Release|x86.ActiveCfg = Release|x86
616618
{6AB50ED0-6273-4919-9ADE-50195664EF15}.Release|x86.Build.0 = Release|x86
617619
{6AB50ED0-6273-4919-9ADE-50195664EF15}.Release|x86.Deploy.0 = Release|x86
620+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.BETA|Any CPU.ActiveCfg = Debug|Any CPU
621+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.BETA|Any CPU.Build.0 = Debug|Any CPU
622+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.BETA|ARM.ActiveCfg = Debug|Any CPU
623+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.BETA|ARM.Build.0 = Debug|Any CPU
624+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.BETA|ARM64.ActiveCfg = Debug|Any CPU
625+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.BETA|ARM64.Build.0 = Debug|Any CPU
626+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.BETA|x64.ActiveCfg = Debug|Any CPU
627+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.BETA|x64.Build.0 = Debug|Any CPU
628+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.BETA|x86.ActiveCfg = Debug|Any CPU
629+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.BETA|x86.Build.0 = Debug|Any CPU
630+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
631+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Debug|Any CPU.Build.0 = Debug|Any CPU
632+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Debug|ARM.ActiveCfg = Debug|Any CPU
633+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Debug|ARM.Build.0 = Debug|Any CPU
634+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Debug|ARM64.ActiveCfg = Debug|Any CPU
635+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Debug|ARM64.Build.0 = Debug|Any CPU
636+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Debug|x64.ActiveCfg = Debug|Any CPU
637+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Debug|x64.Build.0 = Debug|Any CPU
638+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Debug|x86.ActiveCfg = Debug|Any CPU
639+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Debug|x86.Build.0 = Debug|Any CPU
640+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Release|Any CPU.ActiveCfg = Release|Any CPU
641+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Release|Any CPU.Build.0 = Release|Any CPU
642+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Release|ARM.ActiveCfg = Release|Any CPU
643+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Release|ARM.Build.0 = Release|Any CPU
644+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Release|ARM64.ActiveCfg = Release|Any CPU
645+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Release|ARM64.Build.0 = Release|Any CPU
646+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Release|x64.ActiveCfg = Release|Any CPU
647+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Release|x64.Build.0 = Release|Any CPU
648+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Release|x86.ActiveCfg = Release|Any CPU
649+
{FA1977D8-5C6F-DF3A-0926-C12A1A415024}.Release|x86.Build.0 = Release|Any CPU
618650
EndGlobalSection
619651
GlobalSection(SolutionProperties) = preSolution
620652
HideSolutionNode = FALSE
@@ -767,6 +799,20 @@ Global
767799
source\WinStorageStreamsData\WinStorageStreamsData.projitems*{e91e3cde-3088-4b12-8472-d2c1c05b7229}*SharedItemsImports = 5
768800
source\WinUIXamlMediaData\WinUIXamlMediaData.projitems*{e91e3cde-3088-4b12-8472-d2c1c05b7229}*SharedItemsImports = 5
769801
source\YamlData\YamlData.projitems*{e91e3cde-3088-4b12-8472-d2c1c05b7229}*SharedItemsImports = 5
802+
source\Animatables\Animatables.projitems*{fa1977d8-5c6f-df3a-0926-c12a1a415024}*SharedItemsImports = 5
803+
source\CompMetadata\CompMetadata.projitems*{fa1977d8-5c6f-df3a-0926-c12a1a415024}*SharedItemsImports = 5
804+
source\DotLottie\DotLottie.projitems*{fa1977d8-5c6f-df3a-0926-c12a1a415024}*SharedItemsImports = 5
805+
source\GenericData\GenericData.projitems*{fa1977d8-5c6f-df3a-0926-c12a1a415024}*SharedItemsImports = 5
806+
source\LottieData\LottieData.projitems*{fa1977d8-5c6f-df3a-0926-c12a1a415024}*SharedItemsImports = 5
807+
source\LottieMetadata\LottieMetadata.projitems*{fa1977d8-5c6f-df3a-0926-c12a1a415024}*SharedItemsImports = 5
808+
source\LottieReader\LottieReader.projitems*{fa1977d8-5c6f-df3a-0926-c12a1a415024}*SharedItemsImports = 5
809+
source\LottieToWinComp\LottieToWinComp.projitems*{fa1977d8-5c6f-df3a-0926-c12a1a415024}*SharedItemsImports = 5
810+
source\Lottie\Lottie.projitems*{fa1977d8-5c6f-df3a-0926-c12a1a415024}*SharedItemsImports = 5
811+
source\UIData\UIData.projitems*{fa1977d8-5c6f-df3a-0926-c12a1a415024}*SharedItemsImports = 5
812+
source\WinCompData\WinCompData.projitems*{fa1977d8-5c6f-df3a-0926-c12a1a415024}*SharedItemsImports = 5
813+
source\WinStorageStreamsData\WinStorageStreamsData.projitems*{fa1977d8-5c6f-df3a-0926-c12a1a415024}*SharedItemsImports = 5
814+
source\WinUIXamlMediaData\WinUIXamlMediaData.projitems*{fa1977d8-5c6f-df3a-0926-c12a1a415024}*SharedItemsImports = 5
815+
source\YamlData\YamlData.projitems*{fa1977d8-5c6f-df3a-0926-c12a1a415024}*SharedItemsImports = 5
770816
source\Animatables\Animatables.projitems*{fc89273a-b2da-4625-8a73-ef02a658d65e}*SharedItemsImports = 13
771817
EndGlobalSection
772818
EndGlobal
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<Project Sdk="MSBuild.Sdk.Extras">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0-windows10.0.26100.0</TargetFramework>
5+
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
6+
<Nullable>enable</Nullable>
7+
<UseUwp>true</UseUwp>
8+
<DefaultLanguage>en-US</DefaultLanguage>
9+
<IsAotCompatible>true</IsAotCompatible>
10+
<DisableRuntimeMarshalling>true</DisableRuntimeMarshalling>
11+
<PackageId>CommunityToolkit.Uwp.Lottie</PackageId>
12+
<PackageTags>UWP Toolkit Windows Animations Lottie XAML</PackageTags>
13+
14+
<DefineConstants>UWPNET</DefineConstants>
15+
<!--
16+
Turn off debugging information for now. It is causing errors with winmd generation because
17+
the build system is creating CommunityToolkit.WinUI.Lottie.compile.pdb but the winmdexp
18+
task expects the name without the "compile." in it.
19+
-->
20+
<DebugType>none</DebugType>
21+
</PropertyGroup>
22+
23+
<PropertyGroup>
24+
<CsWinRTComponent>true</CsWinRTComponent>
25+
<CsWinRTGenerateProjection>false</CsWinRTGenerateProjection>
26+
</PropertyGroup>
27+
28+
<ItemGroup>
29+
<PackageReference Include="Microsoft.UI.Xaml" Version="2.8.7" />
30+
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.2.0" />
31+
<PackageReference Include="Win2D.uwp" Version="1.28.2" />
32+
</ItemGroup>
33+
34+
<Import Project="..\Lottie-Windows.props" />
35+
<Import Project="..\..\source\Animatables\Animatables.projitems" Label="Shared" />
36+
<Import Project="..\..\source\DotLottie\DotLottie.projitems" Label="Shared" />
37+
<Import Project="..\..\source\CompMetadata\CompMetadata.projitems" Label="Shared" />
38+
<Import Project="..\..\source\GenericData\GenericData.projitems" Label="Shared" />
39+
<Import Project="..\..\source\Lottie\Lottie.projitems" Label="Shared" />
40+
<Import Project="..\..\source\LottieData\LottieData.projitems" Label="Shared" />
41+
<Import Project="..\..\source\LottieMetadata\LottieMetadata.projitems" Label="Shared" />
42+
<Import Project="..\..\source\LottieReader\LottieReader.projitems" Label="Shared" />
43+
<Import Project="..\..\source\LottieToWinComp\LottieToWinComp.projitems" Label="Shared" />
44+
<Import Project="..\..\source\UIData\UIData.projitems" Label="Shared" />
45+
<Import Project="..\..\source\WinCompData\WinCompData.projitems" Label="Shared" />
46+
<Import Project="..\..\source\WinStorageStreamsData\WinStorageStreamsData.projitems" Label="Shared" />
47+
<Import Project="..\..\source\WinUIXamlMediaData\WinUIXamlMediaData.projitems" Label="Shared" />
48+
<Import Project="..\..\source\YamlData\YamlData.projitems" Label="Shared" />
49+
50+
</Project>

azure-pipelines.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ steps:
5959
workingDirectory: .\build
6060

6161
# Sign the result of the build.
62-
- task: PowerShell@2
63-
displayName: Authenticode Sign Packages
64-
inputs:
65-
filePath: build/Sign-Package.ps1
66-
env:
67-
SignClientUser: $(SignClientUser)
68-
SignClientSecret: $(SignClientSecret)
69-
ArtifactDirectory: bin\nupkg
70-
condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest')), not(eq(variables['SignClientSecret'], '')), not(eq(variables['SignClientUser'], '')))
62+
# - task: PowerShell@2
63+
# displayName: Authenticode Sign Packages
64+
# inputs:
65+
# filePath: build/Sign-Package.ps1
66+
# env:
67+
# SignClientUser: $(SignClientUser)
68+
# SignClientSecret: $(SignClientSecret)
69+
# ArtifactDirectory: bin\nupkg
70+
# condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest')), not(eq(variables['SignClientSecret'], '')), not(eq(variables['SignClientUser'], '')))
7171

7272
# Publish the results of the build.
7373
- task: PublishBuildArtifacts@1

source/Lottie/LottieVisualSource.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public sealed partial class LottieVisualSource : DependencyObject, IDynamicAnima
3434
{
3535
#if WINAPPSDK
3636
HashSet<TypedEventHandler<IDynamicAnimatedVisualSource?, object?>> _compositionInvalidatedEventTokenTable = new HashSet<TypedEventHandler<IDynamicAnimatedVisualSource?, object?>>();
37+
#elif UWPNET
38+
HashSet<TypedEventHandler<IDynamicAnimatedVisualSource?, object?>> _compositionInvalidatedEventTokenTable = new HashSet<TypedEventHandler<IDynamicAnimatedVisualSource?, object?>>();
3739
#else
3840
EventRegistrationTokenTable<TypedEventHandler<IDynamicAnimatedVisualSource?, object?>>? _compositionInvalidatedEventTokenTable;
3941
#endif
@@ -162,6 +164,8 @@ public IAsyncAction SetSourceAsync(Uri sourceUri)
162164
{
163165
#if WINAPPSDK
164166
_compositionInvalidatedEventTokenTable.Add(value);
167+
#elif UWPNET
168+
_compositionInvalidatedEventTokenTable.Add(value);
165169
#else
166170
return EventRegistrationTokenTable<TypedEventHandler<IDynamicAnimatedVisualSource?, object?>>
167171
.GetOrCreateEventRegistrationTokenTable(ref _compositionInvalidatedEventTokenTable)
@@ -173,6 +177,8 @@ public IAsyncAction SetSourceAsync(Uri sourceUri)
173177
{
174178
#if WINAPPSDK
175179
_compositionInvalidatedEventTokenTable.Remove(value);
180+
#elif UWPNET
181+
_compositionInvalidatedEventTokenTable.Remove(value);
176182
#else
177183
EventRegistrationTokenTable<TypedEventHandler<IDynamicAnimatedVisualSource?, object?>>
178184
.GetOrCreateEventRegistrationTokenTable(ref _compositionInvalidatedEventTokenTable)
@@ -230,6 +236,11 @@ void NotifyListenersThatCompositionChanged()
230236
{
231237
v.Invoke(this, null);
232238
}
239+
#elif UWPNET
240+
foreach (var v in _compositionInvalidatedEventTokenTable)
241+
{
242+
v.Invoke(this, null);
243+
}
233244
#else
234245
EventRegistrationTokenTable<TypedEventHandler<IDynamicAnimatedVisualSource?, object?>>
235246
.GetOrCreateEventRegistrationTokenTable(ref _compositionInvalidatedEventTokenTable)

source/UIData/Tools/Canonicalizer.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ from item in items
146146
let obj = item.Object
147147
where (_ignoreCommentProperties || obj.Comment is null)
148148
&& obj.Properties.Names.Count == 0
149-
&& obj.Animators.Count == 0
149+
&& obj.Animators.Count() == 0
150150
select (item.Node, obj);
151151
}
152152

@@ -474,19 +474,19 @@ public bool Equals(ThemeBrushKey? other)
474474
// has the same properties and the same animations.
475475
var thispAnimators = thisPropertySet.Animators;
476476
var otherpAnimators = otherPropertySet.Animators;
477-
if (thispAnimators.Count != otherpAnimators.Count)
477+
if (thispAnimators.Count() != otherpAnimators.Count())
478478
{
479479
return false;
480480
}
481481

482-
if (thispAnimators.Count != 1)
482+
if (thispAnimators.Count() != 1)
483483
{
484484
// For now we only handle a single animator.
485485
return false;
486486
}
487487

488-
var thisAnimator = thispAnimators[0];
489-
var otherAnimator = otherpAnimators[0];
488+
var thisAnimator = thispAnimators.ElementAt(0);
489+
var otherAnimator = otherpAnimators.ElementAt(0);
490490
if (thisAnimator.AnimatedProperty != otherAnimator.AnimatedProperty)
491491
{
492492
return false;
@@ -566,7 +566,7 @@ from item in nodes
566566
var grouping =
567567
from item in items
568568
let obj = item.obj
569-
where obj.Animators.Count == 0
569+
where obj.Animators.Count() == 0
570570
group item.Node by CanonicalObject<ICompositionSurface>(obj.Surface) into grouped
571571
select grouped;
572572

@@ -657,15 +657,15 @@ from item in GetCompositionObjects<CompositionPathGeometry>(CompositionObjectTyp
657657
let obj = item.Object
658658
where (_ignoreCommentProperties || obj.Comment is null)
659659
&& obj.Properties.Names.Count == 0
660-
&& obj.Animators.Count == 1
661-
let animator = obj.Animators[0]
660+
&& obj.Animators.Count() == 1
661+
let animator = obj.Animators.ElementAt(0)
662662
where animator.AnimatedProperty == "Path"
663663
select (Node: item.Node, Object: obj);
664664

665665
var grouping =
666666
from item in items
667667
let obj = item.Object
668-
let animation = CanonicalObject<PathKeyFrameAnimation>(obj.Animators[0].Animation)
668+
let animation = CanonicalObject<PathKeyFrameAnimation>(obj.Animators.ElementAt(0).Animation)
669669
group item.Node by (
670670
animation,
671671
obj.TrimStart,

source/UIData/Tools/GraphCompactor.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -268,17 +268,17 @@ static bool IsEquivalentContainer(CompositionContainerShape a, CompositionContai
268268
return AreAnimatorsEquivalent(a.Animators, b.Animators);
269269
}
270270

271-
static bool AreAnimatorsEquivalent(IReadOnlyList<CompositionObject.Animator> a, IReadOnlyList<CompositionObject.Animator> b)
271+
static bool AreAnimatorsEquivalent(IEnumerable<CompositionObject.Animator> a, IEnumerable<CompositionObject.Animator> b)
272272
{
273-
if (a.Count != b.Count)
273+
if (a.Count() != b.Count())
274274
{
275275
return false;
276276
}
277277

278-
for (var i = 0; i < a.Count; i++)
278+
for (var i = 0; i < a.Count(); i++)
279279
{
280-
var animatorA = a[i];
281-
var animatorB = b[i];
280+
var animatorA = a.ElementAt(i);
281+
var animatorB = b.ElementAt(i);
282282

283283
if (animatorA.AnimatedProperty != animatorB.AnimatedProperty)
284284
{
@@ -311,7 +311,7 @@ n.Object is ContainerVisual container &&
311311
(GetNonDefaultContainerVisualProperties(container) & (PropertyId.Clip | PropertyId.Size | PropertyId.Children))
312312
== (PropertyId.Clip | PropertyId.Size | PropertyId.Children) &&
313313
container.Clip?.Type == CompositionObjectType.InsetClip &&
314-
container.Animators.Count == 0 &&
314+
container.Animators.Count() == 0 &&
315315
container.Properties.Names.Count == 0 &&
316316
container.Children.Count == 1 &&
317317
container.Children[0].Type == CompositionObjectType.ShapeVisual
@@ -447,7 +447,7 @@ void PushContainerShapeTransformsDown(
447447

448448
var containerProperties = GetNonDefaultShapeProperties(container);
449449

450-
if (container.Animators.Count != 0 || (containerProperties & ~PropertyId.TransformMatrix) != PropertyId.None)
450+
if (container.Animators.Count() != 0 || (containerProperties & ~PropertyId.TransformMatrix) != PropertyId.None)
451451
{
452452
// Ignore this container if it has animators or anything other than the transform is set.
453453
return false;
@@ -498,7 +498,7 @@ void ElideStructuralContainerShapes(
498498
var container = n.container;
499499
var containerProperties = GetNonDefaultShapeProperties(container);
500500

501-
if (container.Animators.Count != 0 || containerProperties != PropertyId.None)
501+
if (container.Animators.Count() != 0 || containerProperties != PropertyId.None)
502502
{
503503
return false;
504504
}
@@ -757,7 +757,7 @@ parent.Clip is InsetClip insetClip &&
757757
insetClip.Scale.HasValue &&
758758
insetClip.LeftInset.HasValue && insetClip.RightInset.HasValue &&
759759
insetClip.TopInset.HasValue && insetClip.BottomInset.HasValue &&
760-
insetClip.Animators.Count == 0 &&
760+
insetClip.Animators.Count() == 0 &&
761761
parent.Size == shapeVisual.Size &&
762762
!IsPropertyAnimated(parent, PropertyId.Size) &&
763763
!IsPropertyAnimated(shapeVisual, PropertyId.Size))
@@ -1353,7 +1353,7 @@ void TransferStructProperty<T>(Func<CompositionShape, T?> get, Action<Compositio
13531353
to.StartAnimation(anim.AnimatedProperty, anim.Animation, anim.Controller);
13541354
}
13551355

1356-
if (anim.Controller is not null && !anim.Controller.IsCustom && (anim.Controller.IsPaused || anim.Controller.Animators.Count > 0))
1356+
if (anim.Controller is not null && !anim.Controller.IsCustom && (anim.Controller.IsPaused || anim.Controller.Animators.Count() > 0))
13571357
{
13581358
var controller = to.TryGetAnimationController(anim.AnimatedProperty)!;
13591359
if (anim.Controller.IsPaused)
@@ -1425,7 +1425,7 @@ void TransferStructProperty<T>(Func<ContainerVisual, T?> get, Action<ContainerVi
14251425
to.StartAnimation(anim.AnimatedProperty, anim.Animation, anim.Controller);
14261426
}
14271427

1428-
if (anim.Controller is not null && !anim.Controller.IsCustom && (anim.Controller.IsPaused || anim.Controller.Animators.Count > 0))
1428+
if (anim.Controller is not null && !anim.Controller.IsCustom && (anim.Controller.IsPaused || anim.Controller.Animators.Count() > 0))
14291429
{
14301430
var controller = to.TryGetAnimationController(anim.AnimatedProperty)!;
14311431
if (anim.Controller.IsPaused)

0 commit comments

Comments
 (0)