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

Commit

Permalink
支持显示综合动态 (#1089)
Browse files Browse the repository at this point in the history
* 支持获取综合动态,并创建转发动态模板

* 添加图文动态支持

* 添加文章动态

* 支持显示动态评论
  • Loading branch information
Richasy authored Apr 21, 2022
1 parent c29dd9a commit 738b699
Show file tree
Hide file tree
Showing 39 changed files with 1,813 additions and 113 deletions.
51 changes: 47 additions & 4 deletions src/App/App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Controls\App\CommonImageEx\CommonImageEx.cs" />
<Compile Include="Controls\App\StaggeredLayout\StaggeredColumnLayout.cs" />
<Compile Include="Controls\App\StaggeredLayout\StaggeredItem.cs" />
<Compile Include="Controls\App\StaggeredLayout\StaggeredLayoutState.cs" />
<Compile Include="Controls\App\TipPopup.xaml.cs">
<DependentUpon>TipPopup.xaml</DependentUpon>
</Compile>
Expand All @@ -48,6 +51,24 @@
<Compile Include="Controls\Common\VerticalRepeaterView\VerticalRepeaterView.Properties.cs" />
<Compile Include="Controls\Common\VideoCard\VideoCard.cs" />
<Compile Include="Controls\Common\VideoCard\VideoCard.Properties.cs" />
<Compile Include="Controls\Dynamic\DynamicArticleItem.xaml.cs">
<DependentUpon>DynamicArticleItem.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\Dynamic\DynamicImageItem.xaml.cs">
<DependentUpon>DynamicImageItem.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\Dynamic\DynamicForwardItem.xaml.cs">
<DependentUpon>DynamicForwardItem.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\Dynamic\DynamicPresenter.xaml.cs">
<DependentUpon>DynamicPresenter.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\Dynamic\DynamicNotSupportItem.xaml.cs">
<DependentUpon>DynamicNotSupportItem.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\App\ImageViewer.xaml.cs">
<DependentUpon>ImageViewer.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\Live\LiveAreaItem.xaml.cs">
<DependentUpon>LiveAreaItem.xaml</DependentUpon>
</Compile>
Expand All @@ -67,6 +88,7 @@
<Compile Include="Controls\Settings\ScreenshotSettingSection.xaml.cs">
<DependentUpon>ScreenshotSettingSection.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\App\StaggeredLayout\StaggeredLayout.cs" />
<Compile Include="Controls\Toolbox\CoverDownloaderView.xaml.cs">
<DependentUpon>CoverDownloaderView.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -152,10 +174,6 @@
<Compile Include="Controls\Common\ReaderView.xaml.cs">
<DependentUpon>ReaderView.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\App\StaggeredLayout\StaggeredColumnLayout.cs" />
<Compile Include="Controls\App\StaggeredLayout\StaggeredItem.cs" />
<Compile Include="Controls\App\StaggeredLayout\StaggeredLayout.cs" />
<Compile Include="Controls\App\StaggeredLayout\StaggeredLayoutState.cs" />
<Compile Include="Controls\Message\ReplyMessageItem.xaml.cs">
<DependentUpon>ReplyMessageItem.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -434,6 +452,7 @@
<Compile Include="Resources\Converter\PlayerDisplayModeConverter.cs" />
<Compile Include="Resources\Converter\PreferCodecConverter.cs" />
<Compile Include="Resources\Converter\SeasonCoverConverter.cs" />
<Compile Include="Resources\Converter\SmallImageConverter.cs" />
<Compile Include="Resources\Converter\SortTypeTextConverter.cs" />
<Compile Include="Resources\Converter\ObjectToBoolConverter.cs" />
<Compile Include="Resources\Converter\ObjectToVisibilityConverter.cs" />
Expand Down Expand Up @@ -583,6 +602,30 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Controls\Dynamic\DynamicArticleItem.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\Dynamic\DynamicImageItem.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\Dynamic\DynamicForwardItem.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\Dynamic\DynamicPresenter.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\Dynamic\DynamicNotSupportItem.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\App\ImageViewer.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\Live\LiveAreaItem.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
1 change: 1 addition & 0 deletions src/App/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<converter:DanmakuLocationConverter x:Key="DanmakuLocationConverter" />
<converter:NumberToVisibilityConverter x:Key="NumberToVisibilityConverter" />
<converter:SubtitleConvertTypeConverter x:Key="SubtitleConvertTypeConverter" />
<converter:SmallImageConverter x:Key="SmallImageConverter" />
</ResourceDictionary>
</Application.Resources>
</Application>
232 changes: 232 additions & 0 deletions src/App/Controls/App/ImageViewer.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
<UserControl
x:Class="Richasy.Bili.App.Controls.ImageViewer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:animations="using:Microsoft.Toolkit.Uwp.UI.Animations"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:icon="using:Richasy.FluentIcon.Uwp"
xmlns:loc="using:Richasy.Bili.Locator.Uwp"
xmlns:local="using:Richasy.Bili.App.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
d:DesignHeight="300"
d:DesignWidth="400"
mc:Ignorable="d">

<UserControl.Resources>
<Style
x:Key="CustomButtonStyle"
BasedOn="{StaticResource DefaultAppBarButtonStyle}"
TargetType="AppBarButton">
<Setter Property="Width" Value="40" />
</Style>
</UserControl.Resources>

<Grid x:Name="Container" Background="{ThemeResource SystemFillColorSolidNeutralBackgroundBrush}">
<animations:Implicit.ShowAnimations>
<animations:OpacityAnimation
From="0"
To="1"
Duration="0:0:0.3" />
</animations:Implicit.ShowAnimations>
<animations:Implicit.HideAnimations>
<animations:OpacityAnimation
From="1"
To="0"
Duration="0:0:0.2" />
</animations:Implicit.HideAnimations>
<Button
x:Name="NextButton"
Width="0"
Height="0"
Click="OnNextButtonClickAsync"
IsTabStop="False"
Opacity="0">
<Button.KeyboardAccelerators>
<KeyboardAccelerator Key="Right" IsEnabled="True" />
</Button.KeyboardAccelerators>
</Button>
<Button
x:Name="PrevButton"
Width="0"
Height="0"
Click="OnPrevButtonClickAsync"
IsTabStop="False"
Opacity="0">
<Button.KeyboardAccelerators>
<KeyboardAccelerator Key="Left" IsEnabled="True" />
</Button.KeyboardAccelerators>
</Button>
<ScrollViewer
x:Name="ImageScrollViewer"
HorizontalScrollBarVisibility="Auto"
HorizontalScrollMode="Enabled"
MaxZoomFactor="1.5"
MinZoomFactor="0.2"
RenderTransformOrigin="0.5,0.5"
Tapped="OnScrollViewerTapped"
VerticalScrollBarVisibility="Auto"
VerticalScrollMode="Enabled"
ViewChanged="OnScrollViewerViewChanged"
ZoomMode="Enabled">
<Image
x:Name="Image"
RenderTransformOrigin="0.5,0.5"
Stretch="None">
<Image.RenderTransform>
<RotateTransform x:Name="RotateTransform" Angle="0" />
</Image.RenderTransform>
</Image>
</ScrollViewer>

<!-- 用于进行图片操作 -->
<Grid
Margin="0,20,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Background="{ThemeResource AppMaskAcrylicBrush}"
BorderBrush="{ThemeResource ControlStrokeColorDefaultBrush}"
BorderThickness="1"
CornerRadius="{StaticResource OverlayCornerRadius}">
<CommandBar
x:Name="TopBar"
VerticalAlignment="Center"
DefaultLabelPosition="Collapsed">
<AppBarButton
x:Name="ZoomInButton"
Style="{StaticResource CustomButtonStyle}"
Click="OnZoomInButtonClick"
Label="{loc:LocaleLocator Name=ZoomIn}"
ToolTipService.ToolTip="{loc:LocaleLocator Name=ZoomIn}">
<AppBarButton.Icon>
<icon:RegularFluentIcon Symbol="ZoomIn20" />
</AppBarButton.Icon>
</AppBarButton>
<AppBarElementContainer Padding="12,0" VerticalAlignment="Center">
<TextBlock
x:Name="FactoryBlock"
Style="{StaticResource CaptionTextBlockStyle}"
VerticalAlignment="Center" />
</AppBarElementContainer>
<AppBarButton
x:Name="ZoomOutButton"
Style="{StaticResource CustomButtonStyle}"
Click="OnZoomOutButtonClick"
Label="{loc:LocaleLocator Name=ZoomOut}"
ToolTipService.ToolTip="{loc:LocaleLocator Name=ZoomOut}">
<AppBarButton.Icon>
<icon:RegularFluentIcon Symbol="ZoomOut20" />
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton
x:Name="RotateButton"
Style="{StaticResource CustomButtonStyle}"
Click="OnRotateButtonClick"
Label="{loc:LocaleLocator Name=Rotate}"
ToolTipService.ToolTip="{loc:LocaleLocator Name=Rotate}">
<AppBarButton.Icon>
<icon:RegularFluentIcon Symbol="RotateRight20" />
</AppBarButton.Icon>
<AppBarButton.KeyboardAccelerators>
<KeyboardAccelerator
Key="R"
IsEnabled="True"
Modifiers="Control" />
</AppBarButton.KeyboardAccelerators>
</AppBarButton>
<AppBarSeparator />
<AppBarButton
Style="{StaticResource CustomButtonStyle}"
Click="OnCopyButtonClickAysnc"
Label="{loc:LocaleLocator Name=CopyToClipboard}"
ToolTipService.ToolTip="{loc:LocaleLocator Name=CopyToClipboard}">
<AppBarButton.Icon>
<icon:RegularFluentIcon Symbol="Copy20" />
</AppBarButton.Icon>
<AppBarButton.KeyboardAccelerators>
<KeyboardAccelerator Key="C" Modifiers="Control" />
</AppBarButton.KeyboardAccelerators>
</AppBarButton>
<AppBarButton
Style="{StaticResource CustomButtonStyle}"
Click="OnSaveButtonClickAsync"
Label="{loc:LocaleLocator Name=SaveTo}"
ToolTipService.ToolTip="{loc:LocaleLocator Name=SaveTo}">
<AppBarButton.Icon>
<icon:RegularFluentIcon Symbol="Save20" />
</AppBarButton.Icon>
<AppBarButton.KeyboardAccelerators>
<KeyboardAccelerator Key="S" Modifiers="Control" />
</AppBarButton.KeyboardAccelerators>
</AppBarButton>

<CommandBar.SecondaryCommands>
<AppBarButton Label="{loc:LocaleLocator Name=Share}">
<AppBarButton.Icon>
<icon:RegularFluentIcon Symbol="Share20" />
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton Label="{loc:LocaleLocator Name=SettingTo}">
<AppBarButton.Flyout>
<MenuFlyout>
<MenuFlyoutItem Click="OnSettingToBackgroundClickAsync" Text="{loc:LocaleLocator Name=SettingToBackground}">
<MenuFlyoutItem.Icon>
<icon:RegularFluentIcon Symbol="VideoBackgroundEffect20" />
</MenuFlyoutItem.Icon>
</MenuFlyoutItem>
<MenuFlyoutItem Click="OnSettingToLockScreenClickAsync" Text="{loc:LocaleLocator Name=SettingToLockScreen}">
<MenuFlyoutItem.Icon>
<icon:RegularFluentIcon Symbol="LockClosed20" />
</MenuFlyoutItem.Icon>
</MenuFlyoutItem>
</MenuFlyout>
</AppBarButton.Flyout>
<AppBarButton.Icon>
<icon:RegularFluentIcon Symbol="ImageArrowForward24" />
</AppBarButton.Icon>
</AppBarButton>
</CommandBar.SecondaryCommands>
</CommandBar>
</Grid>

<Grid
x:Name="ImageListContainer"
Margin="20,0,20,20"
Padding="8"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Background="{ThemeResource AppMaskAcrylicBrush}"
CornerRadius="{StaticResource ControlCornerRadius}">
<ScrollViewer
HorizontalScrollBarVisibility="Auto"
HorizontalScrollMode="Enabled"
VerticalScrollMode="Disabled">
<muxc:ItemsRepeater x:Name="ImageRepeater" ItemsSource="{x:Bind ImageUrls}">
<muxc:ItemsRepeater.Layout>
<muxc:StackLayout
DisableVirtualization="True"
Orientation="Horizontal"
Spacing="4" />
</muxc:ItemsRepeater.Layout>
<muxc:ItemsRepeater.ItemTemplate>
<DataTemplate x:DataType="x:String">
<local:CardPanel
Width="100"
Height="80"
Click="OnImageItemClickAsync"
DataContext="{x:Bind}"
IsEnableHoverAnimation="False"
StrokeThickness="2">
<local:CommonImageEx
Margin="4"
CornerRadius="2"
ImageUrl="{x:Bind Converter={StaticResource SmallImageConverter}}"
Stretch="UniformToFill" />
</local:CardPanel>
</DataTemplate>
</muxc:ItemsRepeater.ItemTemplate>
</muxc:ItemsRepeater>
</ScrollViewer>
</Grid>
</Grid>
</UserControl>
Loading

0 comments on commit 738b699

Please sign in to comment.