Skip to content

Commit

Permalink
improve the effect of app background
Browse files Browse the repository at this point in the history
  • Loading branch information
Scighost committed Dec 19, 2024
1 parent e0d1c40 commit fc806cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/Starward/Features/Background/AppBackground.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,12 @@ public async Task UpdateBackgroundAsync()
{
try
{
DisposeVideoResource();
cancelSource?.Cancel();
cancelSource = new();
BackgroundImageSource = null;

if (CurrentGameId is null)
{
DisposeVideoResource();
BackgroundImageSource = new BitmapImage(new Uri("ms-appx:///Assets/Image/UI_CutScene_1130320101A.png"));
return;
}
Expand All @@ -160,6 +159,10 @@ public async Task UpdateBackgroundAsync()
{
return;
}

DisposeVideoResource();
BackgroundImageSource = null;

if (file != null)
{
if (BackgroundService.FileIsSupportedVideo(file))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<VisualState x:Name="Loaded">
<Storyboard>
<DoubleAnimation AutoReverse="False"
BeginTime="0"
BeginTime="0:0:0.3"
Storyboard.TargetName="PlaceholderImage"
Storyboard.TargetProperty="Opacity"
To="0"
Expand All @@ -64,13 +64,13 @@
Storyboard.TargetName="PlaceholderImage"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0:0:0.3" />
Duration="0" />
<DoubleAnimation AutoReverse="False"
BeginTime="0"
Storyboard.TargetName="Image"
Storyboard.TargetProperty="Opacity"
To="0"
Duration="0:0:0.3" />
Duration="0" />
</Storyboard>
</VisualState>
</VisualStateGroup>
Expand Down

0 comments on commit fc806cb

Please sign in to comment.