Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lindexi_gd
Uno
提交
43851b3e
U
Uno
项目概览
lindexi_gd
/
Uno
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
Uno
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
43851b3e
编写于
3月 29, 2023
作者:
J
Jérôme Laban
提交者:
GitHub
3月 29, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11842 from unoplatform/dev/jela/lottie-opaque
fix(lottie): Ensure that opaque state is adjusted on any Loaded event
上级
29265a98
f862e18a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
32 addition
and
18 deletion
+32
-18
src/AddIns/Uno.UI.Lottie/LottieVisualSource.Skottie.cs
src/AddIns/Uno.UI.Lottie/LottieVisualSource.Skottie.cs
+19
-16
src/SamplesApp/UITests.Shared/Lottie/LottieProgressPage.xaml
src/SamplesApp/UITests.Shared/Lottie/LottieProgressPage.xaml
+6
-2
src/SamplesApp/UITests.Shared/Lottie/LottieProgressPage.xaml.cs
...mplesApp/UITests.Shared/Lottie/LottieProgressPage.xaml.cs
+7
-0
未找到文件。
src/AddIns/Uno.UI.Lottie/LottieVisualSource.Skottie.cs
浏览文件 @
43851b3e
...
...
@@ -25,6 +25,7 @@ using System.IO;
#if HAS_UNO_WINUI
using
SkiaSharp.Views.Windows
;
using
Windows.UI.Core
;
#else
using
SkiaSharp.Views.UWP
;
#endif
...
...
@@ -216,26 +217,28 @@ namespace Microsoft.Toolkit.Uwp.UI.Lottie
{
if
(
_hardwareCanvas
!=
null
)
{
void
UpdateTransparency
(
object
s
,
object
e
)
static
void
UpdateTransparency
(
object
s
,
object
e
)
{
// The SKGLTextureView is opaque by default, so we poke at the tree
// to change the opacity of the first view of the SKSwapChainPanel
// to make it transparent.
#if __ANDROID__
if
(
_hardwareCanvas
.
ChildCount
==
1
&&
_hardwareCanvas
.
GetChildAt
(
0
)
is
Android
.
Views
.
TextureView
texture
)
if
(
s
is
SKSwapChainPanel
swapChainPanel
)
{
texture
.
SetOpaque
(
false
);
}
// The SKGLTextureView is opaque by default, so we poke at the tree
// to change the opacity of the first view of the SKSwapChainPanel
// to make it transparent.
#if __ANDROID__
if
(
swapChainPanel
.
ChildCount
==
1
&&
swapChainPanel
.
GetChildAt
(
0
)
is
Android
.
Views
.
TextureView
texture
)
{
texture
.
SetOpaque
(
false
);
}
#elif __IOS__
if
(
_hardwareCanvas
.
Subviews
.
Length
==
1
&&
_hardwareCanvas
.
Subviews
[
0
]
is
GLKit
.
GLKView
texture
)
{
texture
.
Opaque
=
false
;
}
if
(
swapChainPanel
.
Subviews
.
Length
==
1
&&
swapChainPanel
.
Subviews
[
0
]
is
GLKit
.
GLKView
texture
)
{
texture
.
Opaque
=
false
;
}
#endif
_hardwareCanvas
.
Loaded
-=
UpdateTransparency
;
}
}
_hardwareCanvas
.
Loaded
+=
UpdateTransparency
;
...
...
src/SamplesApp/UITests.Shared/Lottie/LottieProgressPage.xaml
浏览文件 @
43851b3e
...
...
@@ -28,7 +28,7 @@
</TextBlock>
<!--#endregion-->
<Border Grid.Row="1">
<Border
x:Name="container"
Grid.Row="1">
<!-- AnimatedVisualPlayer -->
<winui:AnimatedVisualPlayer x:Name="Progress_Player"
AutoPlay="False">
...
...
@@ -43,6 +43,7 @@
<!-- Light Switch and Progress Slider -->
<Grid Grid.Row="2" RowSpacing="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
...
...
@@ -55,8 +56,11 @@
Toggled="LightToggle_Toggled">
Light Switch
</ToggleSwitch>
<Button Grid.Column="1"
Content="ReloadView"
Click="{x:Bind OnReloadView}" />
<!-- Progress Slider: Scrub animation frames -->
<Grid Grid.Column="
1
">
<Grid Grid.Column="
2
">
<StackPanel>
<TextBlock Margin="40,20,0,5">Progress Slider</TextBlock>
<Slider x:Name="ProgressSlider"
...
...
src/SamplesApp/UITests.Shared/Lottie/LottieProgressPage.xaml.cs
浏览文件 @
43851b3e
...
...
@@ -20,6 +20,13 @@ namespace UITests.Lottie
var
_
=
InitializeJsonSource
();
}
private
async
void
OnReloadView
()
{
container
.
Child
=
null
;
await
Task
.
Delay
(
2000
);
container
.
Child
=
Progress_Player
;
}
private
async
Task
InitializeJsonSource
()
{
// We'll need to set the JSON Source in code-behind in order to await it ...
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录