diff --git a/src/MonsterSiren.Uwp/Package.appxmanifest b/src/MonsterSiren.Uwp/Package.appxmanifest
index 2798426..81f7b7c 100644
--- a/src/MonsterSiren.Uwp/Package.appxmanifest
+++ b/src/MonsterSiren.Uwp/Package.appxmanifest
@@ -10,7 +10,7 @@
+ Version="1.1.2.0" />
diff --git a/src/MonsterSiren.Uwp/Services/MusicService.cs b/src/MonsterSiren.Uwp/Services/MusicService.cs
index 80db5e2..e7fd57b 100644
--- a/src/MonsterSiren.Uwp/Services/MusicService.cs
+++ b/src/MonsterSiren.Uwp/Services/MusicService.cs
@@ -209,7 +209,7 @@ static MusicService()
mediaPlayer.Source = mediaPlaybackList;
CurrentMediaPlaybackList = new NowPlayingList(mediaPlaybackList.Items);
- //下面的事件处理器在 UI 线程引发事件,这样可以让与 UI 相关的代码在处理这些事件时不会出错
+ // 下面的事件处理器在 UI 线程引发事件,这样可以让与 UI 相关的代码在处理这些事件时不会出错
mediaPlayer.VolumeChanged += async (sender, arg) =>
{
double volume = sender.Volume;
diff --git a/src/MonsterSiren.Uwp/ViewModels/GlanceViewViewModel.cs b/src/MonsterSiren.Uwp/ViewModels/GlanceViewViewModel.cs
index b4b047e..fd8e7f7 100644
--- a/src/MonsterSiren.Uwp/ViewModels/GlanceViewViewModel.cs
+++ b/src/MonsterSiren.Uwp/ViewModels/GlanceViewViewModel.cs
@@ -15,7 +15,7 @@ public sealed partial class GlanceViewViewModel : ObservableObject
[ObservableProperty]
private double _contentOffset;
[ObservableProperty]
- private bool showPausedState = MusicService.PlayerPlayBackState == MediaPlaybackState.Paused;
+ private bool showPlayState = MusicService.PlayerPlayBackState is MediaPlaybackState.Paused or MediaPlaybackState.Buffering or MediaPlaybackState.Opening;
[ObservableProperty]
private bool showMuteState = MusicService.IsPlayerMuted;
[ObservableProperty]
@@ -40,7 +40,7 @@ private void OnMusicServicePlayerMuteStateChanged(bool state)
private void OnMusicServicePlayerPlaybackStateChanged(MediaPlaybackState state)
{
- ShowPausedState = state == MediaPlaybackState.Paused;
+ ShowPlayState = state is MediaPlaybackState.Paused or MediaPlaybackState.Buffering or MediaPlaybackState.Opening;
}
~GlanceViewViewModel()
diff --git a/src/MonsterSiren.Uwp/Views/GlanceViewPage.xaml b/src/MonsterSiren.Uwp/Views/GlanceViewPage.xaml
index a476f04..10c363b 100644
--- a/src/MonsterSiren.Uwp/Views/GlanceViewPage.xaml
+++ b/src/MonsterSiren.Uwp/Views/GlanceViewPage.xaml
@@ -66,11 +66,11 @@
x:Load="{x:Bind ViewModel.ShowMeteredInternet, Mode=OneWay}"
Symbol="FourBars" />
+ Glyph="{x:Bind ViewModel.MusicInfo.PlayIconGlyph, Mode=OneWay}" />
- {
- _brightnessOverride = BrightnessOverride.GetForCurrentView();
- if (_brightnessOverride.IsSupported)
- {
- _brightnessOverride.SetBrightnessLevel(0.1, DisplayBrightnessOverrideOptions.UseDimmedPolicyWhenBatteryIsLow);
- _brightnessOverride.StartOverride();
- }
- });
- brightnessTask.Wait(300);
- }
}
private void OnPageSizeChanged(object sender, SizeChangedEventArgs e)
@@ -92,7 +78,7 @@ private void AdjustContentPosition()
}
}
- protected override void OnNavigatedTo(NavigationEventArgs e)
+ protected override async void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
@@ -101,6 +87,19 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
{
view.TryEnterFullScreenMode();
}
+
+ if (SettingsHelper.TryGet(CommonValues.AppGlanceModeUseLowerBrightnessSettingsKey, out bool useLowerBrightness) && useLowerBrightness)
+ {
+ await UIThreadHelper.RunOnUIThread(() =>
+ {
+ _brightnessOverride = BrightnessOverride.GetForCurrentView();
+ if (_brightnessOverride.IsSupported)
+ {
+ _brightnessOverride.SetBrightnessLevel(0.1, DisplayBrightnessOverrideOptions.UseDimmedPolicyWhenBatteryIsLow);
+ _brightnessOverride.StartOverride();
+ }
+ });
+ }
}
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)