Skip to content

Commit

Permalink
fix: fix progressring lottie source from uwp/winui split (#1367)
Browse files Browse the repository at this point in the history
* fix: fix progressring lottie source from uwp/winui split

* chore: rename namespace aliases
  • Loading branch information
kazo0 authored Mar 25, 2024
1 parent 2fa3e59 commit d2eb75c
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 12 deletions.
10 changes: 7 additions & 3 deletions src/library/Uno.Cupertino/Styles/Controls/ProgressRing.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
xmlns:not_win="http://uno.ui/not_win"
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:uwp="http://uno.ui/uwp"
xmlns:winui="http://uno.ui/winui"
xmlns:lottie_not_win="#using:Microsoft.Toolkit.Uwp.UI.Lottie;CommunityToolkit.WinUI.Lottie"
mc:Ignorable="d not_win lottie_not_win">
mc:Ignorable="d not_win lottie_not_win uwp winui">
<ResourceDictionary.MergedDictionaries>
<not_win:ResourceDictionary>
<lottie_not_win:LottieVisualSource x:Key="CupertinoDeterminateAnimation_Uno"
UriSource="embedded://Uno.Cupertino/Uno.Cupertino.Assets.CupertinoProgressRing.json" />
uwp:UriSource="embedded://Uno.Cupertino/Uno.Cupertino.Assets.CupertinoProgressRing.json"
winui:UriSource="embedded://Uno.Cupertino.WinUI/Uno.Cupertino.WinUI.Assets.CupertinoProgressRing.json" />
<lottie_not_win:LottieVisualSource x:Key="CupertinoIndeterminateAnimation_Uno"
UriSource="embedded://Uno.Cupertino/Uno.Cupertino.Assets.CupertinoProgressRing.json" />
uwp:UriSource="embedded://Uno.Cupertino/Uno.Cupertino.Assets.CupertinoProgressRing.json"
winui:UriSource="embedded://Uno.Cupertino.WinUI/Uno.Cupertino.WinUI.Assets.CupertinoProgressRing.json" />

</not_win:ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
Expand Down
27 changes: 25 additions & 2 deletions src/library/Uno.Cupertino/cupertino-common.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project>
<Project>
<PropertyGroup>
<AllowedOutputExtensionsInPackageBuildOutputFolder>.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -26,6 +26,29 @@
</Otherwise>
</Choose>

<!-- NOTE: These two conditionals ONLY work under Uno targets and not Windows Desktop so they need to be used within the context of not_win or finer constraints -->
<!-- Make sure to add these aliases to the mc:Ignorable when using -->
<Choose>
<When Condition="'$(FrameworkLineage)'=='UWP'">
<ItemGroup>
<IncludeXamlNamespaces Include="uwp" />
<ExcludeXamlNamespaces Include="winui" />
</ItemGroup>
</When>
<When Condition="'$(FrameworkLineage)'=='WinUI'">
<ItemGroup>
<IncludeXamlNamespaces Include="winui" />
<ExcludeXamlNamespaces Include="uwp" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<ExcludeXamlNamespaces Include="winui" />
<ExcludeXamlNamespaces Include="uwp" />
</ItemGroup>
</Otherwise>
</Choose>

<ItemGroup>
<LottieJson Include="Assets\CupertinoProgressRing.json" />
</ItemGroup>
Expand Down Expand Up @@ -69,4 +92,4 @@
</ItemGroup>

<Import Project="..\xamlmerge.targets" />
</Project>
</Project>
10 changes: 7 additions & 3 deletions src/library/Uno.Material/Styles/Controls/v1/ProgressRing.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:not_win="http://uno.ui/not_win"
xmlns:uwp="http://uno.ui/uwp"
xmlns:winui="http://uno.ui/winui"
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
mc:Ignorable="d not_win lottie_not_win">
mc:Ignorable="d not_win lottie_not_win uwp winui">
<ResourceDictionary.MergedDictionaries>
<not_win:ResourceDictionary>
<lottie_not_win:LottieVisualSource x:Key="MaterialDeterminateAnimation_Uno"
UriSource="embedded://Uno.Material/Uno.Material.Assets.MaterialDeterminate.json" />
uwp:UriSource="embedded://Uno.Material/Uno.Material.Assets.MaterialDeterminate.json"
winui:UriSource="embedded://Uno.Material.WinUI/Uno.Material.WinUI.Assets.MaterialDeterminate.json" />
<lottie_not_win:LottieVisualSource x:Key="MaterialIndeterminateAnimation_Uno"
UriSource="embedded://Uno.Material/Uno.Material.Assets.MaterialIndeterminate.json" />
uwp:UriSource="embedded://Uno.Material/Uno.Material.Assets.MaterialIndeterminate.json"
winui:UriSource="embedded://Uno.Material.WinUI/Uno.Material.WinUI.Assets.MaterialIndeterminate.json" />
</not_win:ResourceDictionary>
</ResourceDictionary.MergedDictionaries>

Expand Down
11 changes: 8 additions & 3 deletions src/library/Uno.Material/Styles/Controls/v2/ProgressRing.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@
xmlns:lottie_not_win="#using:Microsoft.Toolkit.Uwp.UI.Lottie;CommunityToolkit.WinUI.Lottie"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:not_win="http://uno.ui/not_win"
xmlns:uwp="http://uno.ui/uwp"
xmlns:winui="http://uno.ui/winui"
xmlns:um="using:Uno.Material"
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d not_win lottie_not_win">
mc:Ignorable="d not_win lottie_not_win uwp winui">

<ResourceDictionary.MergedDictionaries>
<not_win:ResourceDictionary>
<lottie_not_win:LottieVisualSource x:Key="MaterialDeterminateAnimation_Uno"
UriSource="embedded://Uno.Material/Uno.Material.Assets.MaterialDeterminate.json" />
uwp:UriSource="embedded://Uno.Material/Uno.Material.Assets.MaterialDeterminate.json"
winui:UriSource="embedded://Uno.Material.WinUI/Uno.Material.WinUI.Assets.MaterialDeterminate.json" />
<lottie_not_win:LottieVisualSource x:Key="MaterialIndeterminateAnimation_Uno"
UriSource="embedded://Uno.Material/Uno.Material.Assets.MaterialIndeterminate.json" />
uwp:UriSource="embedded://Uno.Material/Uno.Material.Assets.MaterialIndeterminate.json"
winui:UriSource="embedded://Uno.Material.WinUI/Uno.Material.WinUI.Assets.MaterialIndeterminate.json" />
</not_win:ResourceDictionary>
</ResourceDictionary.MergedDictionaries>

Expand Down
25 changes: 24 additions & 1 deletion src/library/Uno.Material/material-common.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,29 @@
</Otherwise>
</Choose>

<!-- NOTE: These two conditionals ONLY work under Uno targets and not Windows Desktop so they need to be used within the context of not_win or finer constraints -->
<!-- Make sure to add these aliases to the mc:Ignorable when using -->
<Choose>
<When Condition="'$(FrameworkLineage)'=='UWP'">
<ItemGroup>
<IncludeXamlNamespaces Include="uwp" />
<ExcludeXamlNamespaces Include="winui" />
</ItemGroup>
</When>
<When Condition="'$(FrameworkLineage)'=='WinUI'">
<ItemGroup>
<IncludeXamlNamespaces Include="winui" />
<ExcludeXamlNamespaces Include="uwp" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<ExcludeXamlNamespaces Include="winui" />
<ExcludeXamlNamespaces Include="uwp" />
</ItemGroup>
</Otherwise>
</Choose>

<ItemGroup>
<LottieJson Include="Assets\MaterialDeterminate.json" />
<LottieJson Include="Assets\MaterialIndeterminate.json" />
Expand Down Expand Up @@ -111,4 +134,4 @@
</ItemGroup>

<Import Project="..\xamlmerge.targets" />
</Project>
</Project>

0 comments on commit d2eb75c

Please sign in to comment.