Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
修复首页推荐刷新错误 (#222)
Browse files Browse the repository at this point in the history
* 修复刷新页面时可能出现的布局问题

* 调整MTC样式
  • Loading branch information
Richasy authored Sep 21, 2021
1 parent 0d6917e commit 57ef85c
Show file tree
Hide file tree
Showing 8 changed files with 204 additions and 202 deletions.
2 changes: 1 addition & 1 deletion src/App/Controls/Danmaku/DanmakuBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<StackPanel
Grid.Column="2"
Orientation="Horizontal"
Spacing="8">
Spacing="6">
<Button
x:Name="DanmakuSendSettingsButton"
AutomationProperties.Name="{loc:LocaleLocator Name=DanmakuSendSettings}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Richasy.Bili.ViewModels.Uwp.Common;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Shapes;

namespace Richasy.Bili.App.Controls
Expand Down Expand Up @@ -51,18 +52,18 @@ public partial class BiliPlayerTransportControls
private DispatcherTimer _danmakuTimer;
private DispatcherTimer _cursorTimer;
private DanmakuView _danmakuView;
private AppBarToggleButton _fullWindowPlayModeButton;
private AppBarToggleButton _fullScreenPlayModeButton;
private AppBarToggleButton _compactOverlayPlayModeButton;
private ToggleButton _fullWindowPlayModeButton;
private ToggleButton _fullScreenPlayModeButton;
private ToggleButton _compactOverlayPlayModeButton;
private Rectangle _interactionControl;
private Border _controlPanel;
private ListView _formatListView;
private ListView _liveQualityListView;
private ListView _livePlayLineListView;
private Button _backButton;
private AppBarButton _backSkipButton;
private AppBarButton _forwardSkipButton;
private AppBarButton _playPauseButton;
private Button _backSkipButton;
private Button _forwardSkipButton;
private Button _playPauseButton;
private int _segmentIndex;
private double _cursorStayTime;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Windows.Media.Playback;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Shapes;

Expand Down Expand Up @@ -48,18 +49,18 @@ public BiliPlayerTransportControls()
protected override void OnApplyTemplate()
{
_danmakuView = GetTemplateChild(DanmakuViewName) as DanmakuView;
_fullWindowPlayModeButton = GetTemplateChild(FullWindowPlayModeButtonName) as AppBarToggleButton;
_fullScreenPlayModeButton = GetTemplateChild(FullScreenPlayModeButtonName) as AppBarToggleButton;
_compactOverlayPlayModeButton = GetTemplateChild(CompactOverlayPlayModeButtonName) as AppBarToggleButton;
_fullWindowPlayModeButton = GetTemplateChild(FullWindowPlayModeButtonName) as ToggleButton;
_fullScreenPlayModeButton = GetTemplateChild(FullScreenPlayModeButtonName) as ToggleButton;
_compactOverlayPlayModeButton = GetTemplateChild(CompactOverlayPlayModeButtonName) as ToggleButton;
_interactionControl = GetTemplateChild(InteractionControlName) as Rectangle;
_controlPanel = GetTemplateChild(ControlPanelName) as Border;
_formatListView = GetTemplateChild(FormatListViewName) as ListView;
_livePlayLineListView = GetTemplateChild(LivePlayLineListViewName) as ListView;
_liveQualityListView = GetTemplateChild(LiveQualityListViewName) as ListView;
_backButton = GetTemplateChild(BackButtonName) as Button;
_backSkipButton = GetTemplateChild(BackSkipButtonName) as AppBarButton;
_forwardSkipButton = GetTemplateChild(ForwardSkipButtonName) as AppBarButton;
_playPauseButton = GetTemplateChild(PlayPauseButtonName) as AppBarButton;
_backSkipButton = GetTemplateChild(BackSkipButtonName) as Button;
_forwardSkipButton = GetTemplateChild(ForwardSkipButtonName) as Button;
_playPauseButton = GetTemplateChild(PlayPauseButtonName) as Button;

_fullWindowPlayModeButton.Click += OnPlayModeButtonClick;
_fullScreenPlayModeButton.Click += OnPlayModeButtonClick;
Expand Down Expand Up @@ -210,7 +211,7 @@ private void OnBackSkipButtonClick(object sender, RoutedEventArgs e)

private void OnPlayModeButtonClick(object sender, RoutedEventArgs e)
{
var btn = sender as AppBarToggleButton;
var btn = sender as ToggleButton;
PlayerDisplayMode mode = default;
switch (btn.Name)
{
Expand Down

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/App/Pages/Overlay/PlayerPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ private async void CheckPlayerDisplayModeAsync()
{
VisualStateManager.GoToState(this, nameof(FullPlayerState), false);
}

}
else if (ViewModel.PlayerDisplayMode == PlayerDisplayMode.CompactOverlay)
{
Expand Down
3 changes: 2 additions & 1 deletion src/App/Pages/PopularPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
x:Name="ContentScrollViewer"
Padding="{StaticResource DefaultContainerPadding}"
HorizontalScrollMode="Disabled"
VerticalScrollBarVisibility="Auto">
VerticalScrollBarVisibility="Auto"
Visibility="{x:Bind ViewModel.IsInitializeLoading, Mode=OneWay, Converter={StaticResource BoolToVisibilityReverseConverter}}">
<controls:VerticalRepeaterView
x:Name="VideoView"
Margin="0,0,0,12"
Expand Down
3 changes: 2 additions & 1 deletion src/App/Pages/RankPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
Margin="0,0,0,12"
HeaderVisibility="Collapsed"
ItemsSource="{x:Bind ViewModel.DisplayVideoCollection}"
MinWideItemHeight="252">
MinWideItemHeight="252"
Visibility="{x:Bind ViewModel.IsInitializeLoading, Mode=OneWay, Converter={StaticResource BoolToVisibilityReverseConverter}}">
<controls:VerticalRepeaterView.ItemTemplate>
<DataTemplate x:DataType="uwp:VideoViewModel">
<controls:VideoItem
Expand Down
3 changes: 2 additions & 1 deletion src/App/Pages/RecommendPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
x:Name="ContentScrollViewer"
Padding="{StaticResource DefaultContainerPadding}"
HorizontalScrollMode="Disabled"
VerticalScrollBarVisibility="Auto">
VerticalScrollBarVisibility="Auto"
Visibility="{x:Bind ViewModel.IsInitializeLoading, Mode=OneWay, Converter={StaticResource BoolToVisibilityReverseConverter}}">
<controls:VerticalRepeaterView
x:Name="VideoView"
Margin="0,0,0,12"
Expand Down

0 comments on commit 57ef85c

Please sign in to comment.