From 37d8c021285be5ae5aa1aa380ded92ed6d598417 Mon Sep 17 00:00:00 2001 From: Richasy Date: Sat, 2 Apr 2022 16:15:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=A0=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E5=AF=BC=E8=87=B4=E7=9A=84=E5=B4=A9=E6=BA=83?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App/App.csproj | 5 + src/App/App.xaml.cs | 6 +- .../BiliPlayerTransportControls.Properties.cs | 9 +- .../BiliPlayerTransportControls.cs | 12 +- .../BiliPlayerTransportControls.xaml | 44 ++----- .../Controls/Player/PlayerTip/PlayerTip.cs | 124 ++++++++++++++++++ .../Controls/Player/PlayerTip/PlayerTip.xaml | 93 +++++++++++++ src/App/Themes/Generic.xaml | 1 + .../ViewModels.Uwp/ViewModels.Uwp.csproj | 3 + 9 files changed, 249 insertions(+), 48 deletions(-) create mode 100644 src/App/Controls/Player/PlayerTip/PlayerTip.cs create mode 100644 src/App/Controls/Player/PlayerTip/PlayerTip.xaml diff --git a/src/App/App.csproj b/src/App/App.csproj index 8dfc17eaf..1eb0378b8 100644 --- a/src/App/App.csproj +++ b/src/App/App.csproj @@ -48,6 +48,7 @@ + ViewLaterView.xaml @@ -571,6 +572,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/src/App/App.xaml.cs b/src/App/App.xaml.cs index d5e4481cf..61c4c3804 100644 --- a/src/App/App.xaml.cs +++ b/src/App/App.xaml.cs @@ -59,7 +59,7 @@ public void Log(LogLevel level, string message) /// Detailed information about the start request and process. protected override void OnLaunched(LaunchActivatedEventArgs e) { - OnLaunchedOrActivated(e); + OnLaunchedOrActivatedAsync(e); } /// @@ -68,10 +68,10 @@ protected override void OnLaunched(LaunchActivatedEventArgs e) /// Detailed information about the active request and process. protected override void OnActivated(IActivatedEventArgs args) { - OnLaunchedOrActivated(args); + OnLaunchedOrActivatedAsync(args); } - private async void OnLaunchedOrActivated(IActivatedEventArgs e) + private async void OnLaunchedOrActivatedAsync(IActivatedEventArgs e) { // 用于解析Flv视频 if (RuntimeInformation.ProcessArchitecture != Architecture.Arm64) diff --git a/src/App/Controls/Player/BiliPlayerTransportControls/BiliPlayerTransportControls.Properties.cs b/src/App/Controls/Player/BiliPlayerTransportControls/BiliPlayerTransportControls.Properties.cs index c1618d250..8f6776602 100644 --- a/src/App/Controls/Player/BiliPlayerTransportControls/BiliPlayerTransportControls.Properties.cs +++ b/src/App/Controls/Player/BiliPlayerTransportControls/BiliPlayerTransportControls.Properties.cs @@ -4,7 +4,6 @@ using Richasy.Bili.Models.Enums.App; using Richasy.Bili.ViewModels.Uwp; using Richasy.Bili.ViewModels.Uwp.Common; -using Windows.Foundation; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls.Primitives; @@ -53,7 +52,7 @@ public partial class BiliPlayerTransportControls private const string SubtitleBlockName = "SubtitleBlock"; private const string HomeButtonName = "HomeButton"; private const string BackToDefaultButtonName = "BackToDefaultButton"; - private const string ContinuePreviousViewButtonName = "ContinuePreviousViewButton"; + private const string PreviousViewInformerName = "PreviousViewInformer"; private const string LiveRefreshButtonName = "LiveRefreshButton"; private const string TempMessageContaienrName = "TempMessageContainer"; private const string TempMessageBlockName = "TempMessageBlock"; @@ -65,7 +64,7 @@ public partial class BiliPlayerTransportControls private const string DecreasePlayRateButtonName = "DecreasePlayRateButton"; private const string IncreaseVolumeButtonName = "IncreaseVolumeButton"; private const string DecreaseVolumeButtonName = "DecreaseVolumeButton"; - private const string PlayNextVideoButtonName = "PlayNextVideoButton"; + private const string NextVideoInformerName = "NextVideoInformer"; private const string VisibilityStateGroupName = "ControlPanelVisibilityStates"; private const string FormatButtonName = "FormatButtonName"; private const string LiveQualityButtonName = "LiveQualityButtonName"; @@ -92,7 +91,6 @@ public partial class BiliPlayerTransportControls private Button _danmakuBarVisibilityButton; private Button _homeButton; private Button _backToDefaultButton; - private Button _continuePreviousViewButton; private Button _liveRefreshButton; private Button _previousEpisodeButton; private Button _nextEpisodeButton; @@ -105,7 +103,8 @@ public partial class BiliPlayerTransportControls private Button _decreasePlayRateButton; private Button _increaseVolumeButton; private Button _decreaseVolumeButton; - private HyperlinkButton _playNextVideoButton; + private PlayerTip _previousViewInformer; + private PlayerTip _nextVidepInformer; private Grid _rootGrid; private VisualStateGroup _visibilityStateGroup; private Button _formatButton; diff --git a/src/App/Controls/Player/BiliPlayerTransportControls/BiliPlayerTransportControls.cs b/src/App/Controls/Player/BiliPlayerTransportControls/BiliPlayerTransportControls.cs index 2a83a4978..b73e28d00 100644 --- a/src/App/Controls/Player/BiliPlayerTransportControls/BiliPlayerTransportControls.cs +++ b/src/App/Controls/Player/BiliPlayerTransportControls/BiliPlayerTransportControls.cs @@ -82,7 +82,6 @@ protected override void OnApplyTemplate() _danmakuBarVisibilityButton = GetTemplateChild(DanmakuBarVisibilityButtonName) as Button; _homeButton = GetTemplateChild(HomeButtonName) as Button; _backToDefaultButton = GetTemplateChild(BackToDefaultButtonName) as Button; - _continuePreviousViewButton = GetTemplateChild(ContinuePreviousViewButtonName) as Button; _liveRefreshButton = GetTemplateChild(LiveRefreshButtonName) as Button; _previousEpisodeButton = GetTemplateChild(PreviousEpisodeButtonName) as Button; _nextEpisodeButton = GetTemplateChild(NextEpisodeButtonName) as Button; @@ -95,7 +94,8 @@ protected override void OnApplyTemplate() _decreasePlayRateButton = GetTemplateChild(DecreasePlayRateButtonName) as Button; _increaseVolumeButton = GetTemplateChild(IncreaseVolumeButtonName) as Button; _decreaseVolumeButton = GetTemplateChild(DecreaseVolumeButtonName) as Button; - _playNextVideoButton = GetTemplateChild(PlayNextVideoButtonName) as HyperlinkButton; + _nextVidepInformer = GetTemplateChild(NextVideoInformerName) as PlayerTip; + _previousViewInformer = GetTemplateChild(PreviousViewInformerName) as PlayerTip; _formatButton = GetTemplateChild(FormatButtonName) as Button; _liveQualityButton = GetTemplateChild(LiveQualityButtonName) as Button; _rootGrid = GetTemplateChild(RootGridName) as Grid; @@ -114,7 +114,6 @@ protected override void OnApplyTemplate() _homeButton.Click += OnHomeButtonClickAsync; _backToDefaultButton.Click += OnBackButtonClick; _liveRefreshButton.Click += OnLiveRefreshButtonClickAsync; - _continuePreviousViewButton.Click += OnContinuePreviousViewButtonClickAsync; _previousEpisodeButton.Click += OnPreviousEpisodeButtonClickAsync; _nextEpisodeButton.Click += OnNextEpisodeButtonClickAsync; _screenshotButton.Click += OnScreenshotButtonClickAsync; @@ -123,7 +122,8 @@ protected override void OnApplyTemplate() _decreasePlayRateButton.Click += OnDecreasePlayRateButtonClick; _increaseVolumeButton.Click += OnIncreaseVolumeButtonClick; _decreaseVolumeButton.Click += OnDecreaseVolumeButtonClick; - _playNextVideoButton.Click += OnPlayNextVideoButtonClickAsync; + _previousViewInformer.ActionClick += OnContinuePreviousViewButtonClickAsync; + _nextVidepInformer.ActionClick += OnPlayNextVideoButtonClickAsync; if (_formatListView != null) { @@ -352,7 +352,7 @@ private async void OnHomeButtonClickAsync(object sender, RoutedEventArgs e) await ViewModel.BackToInteractionStartAsync(); } - private async void OnContinuePreviousViewButtonClickAsync(object sender, RoutedEventArgs e) + private async void OnContinuePreviousViewButtonClickAsync(object sender, EventArgs e) { ViewModel.IsShowHistoryTip = false; ViewModel.HistoryTipText = string.Empty; @@ -1011,7 +1011,7 @@ private void OnIncreaseVolumeButtonClick(object sender, RoutedEventArgs e) } } - private async void OnPlayNextVideoButtonClickAsync(object sender, RoutedEventArgs e) + private async void OnPlayNextVideoButtonClickAsync(object sender, EventArgs e) { ViewModel.IsShowNextVideoTip = false; _nextVideoHoldSeconds = 0; diff --git a/src/App/Controls/Player/BiliPlayerTransportControls/BiliPlayerTransportControls.xaml b/src/App/Controls/Player/BiliPlayerTransportControls/BiliPlayerTransportControls.xaml index 9d178dac9..337d6fddb 100644 --- a/src/App/Controls/Player/BiliPlayerTransportControls/BiliPlayerTransportControls.xaml +++ b/src/App/Controls/Player/BiliPlayerTransportControls/BiliPlayerTransportControls.xaml @@ -66,13 +66,6 @@ x:Key="MediaControlButtonStyle" BasedOn="{StaticResource DefaultButtonStyle}" TargetType="Button" /> - + diff --git a/src/App/Themes/Generic.xaml b/src/App/Themes/Generic.xaml index b75bcfb4f..3c688e66e 100644 --- a/src/App/Themes/Generic.xaml +++ b/src/App/Themes/Generic.xaml @@ -13,5 +13,6 @@ + diff --git a/src/ViewModels/ViewModels.Uwp/ViewModels.Uwp.csproj b/src/ViewModels/ViewModels.Uwp/ViewModels.Uwp.csproj index 346c2f87d..ce27c37ae 100644 --- a/src/ViewModels/ViewModels.Uwp/ViewModels.Uwp.csproj +++ b/src/ViewModels/ViewModels.Uwp/ViewModels.Uwp.csproj @@ -159,6 +159,9 @@ 17.1.50 + + 17.1.50 + 1.0.0