Skip to content

Commit

Permalink
Merge pull request #916 from ywmoyue/dev
Browse files Browse the repository at this point in the history
4.7.7
  • Loading branch information
ywmoyue authored Nov 20, 2024
2 parents c4e0e44 + 1603bb0 commit f7dbb70
Show file tree
Hide file tree
Showing 91 changed files with 3,295 additions and 1,892 deletions.
58 changes: 13 additions & 45 deletions src/BiliLite.UWP/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,23 @@
x:Class="BiliLite.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:muxm="using:Microsoft.UI.Xaml.Media"
xmlns:local="using:BiliLite"
xmlns:Custom="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:convert="using:BiliLite.Converters">
xmlns:local="using:BiliLite">
<Application.Resources>

<ResourceDictionary >

<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"/>
<ResourceDictionary Source="ms-appx:///Controls/Carousel/Carousel.xaml"/>
<ResourceDictionary Source="ms-appx:///Controls/RoundButton/RoundButton.xaml"/>
<ResourceDictionary Source="ms-appx:///Controls/ScrollGridView/ScrollGridView.xaml"/>
<ResourceDictionary Source="ms-appx:///Styles/TabViewStyle.xaml"/>
<ResourceDictionary Source="ms-appx:///Styles/AppBarButtonNoChevronStyle.xaml"/>
<ResourceDictionary Source="Controls/Carousel/Carousel.xaml" />
<ResourceDictionary Source="Controls/RoundButton/RoundButton.xaml" />
<ResourceDictionary Source="Controls/ScrollGridView/ScrollGridView.xaml" />
<ResourceDictionary Source="Styles/AppBarButtonNoChevronStyle.xaml" />
<ResourceDictionary Source="Styles/TabViewStyle.xaml" />
<ResourceDictionary Source="Styles/TextBlockStyle.xaml" />
<ResourceDictionary Source="Themes/Breakpoint.xaml" />
<ResourceDictionary Source="Themes/Converter.xaml" />
<ResourceDictionary Source="Themes/Colors.xaml" />
<ResourceDictionary Source="Themes/Fonts.xaml" />
</ResourceDictionary.MergedDictionaries>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary Source="ms-appx:///Themes/Light.xaml" x:Key="Light"/>
<ResourceDictionary Source="ms-appx:///Themes/Dark.xaml" x:Key="Dark"/>
<ResourceDictionary x:Key="Default">
<SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="Transparent" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

<SolidColorBrush x:Key="DefaultTextColor" Color="{ThemeResource TextColor}"></SolidColorBrush>
<SolidColorBrush x:Key="DefaultCardColor" Color="{ThemeResource CardColor}"></SolidColorBrush>
<convert:NumberToStringConvert x:Key="numberToStringConvert"></convert:NumberToStringConvert>
<Style x:Key="BaseTextBlockStyle" TargetType="TextBlock">
<Setter Property="FontFamily" Value="XamlAutoFontFamily"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="TextTrimming" Value="None"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="LineStackingStrategy" Value="MaxHeight"/>
<Setter Property="TextLineBounds" Value="Full"/>
</Style>
<Style x:Key="CaptionTextBlockStyle" BasedOn="{StaticResource BaseTextBlockStyle}" TargetType="TextBlock">
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontWeight" Value="Normal"/>
</Style>
<convert:ImageCompressionConvert x:Key="imageConvert"></convert:ImageCompressionConvert>
<convert:ImageSourceConvert x:Key="imageConvert2"></convert:ImageSourceConvert>
<convert:DisplayConvert x:Key="display"></convert:DisplayConvert>
<convert:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"></convert:BoolToVisibilityConverter>
<FontFamily x:Key="VanFont">ms-appx:///Assets/Fonts/vanfont.otf#vanfont</FontFamily>
<FontFamily x:Key="BiliIconFont">ms-appx:///Assets/Fonts/biliicon.ttf#biliicon</FontFamily>

<CornerRadius x:Key="ImageCornerRadius">4</CornerRadius>
<!--该字体来自哔哩哔哩Web端,该字体可能需要商业授权-->
<FontFamily x:Key="FansNum">ms-appx:///Assets/Fonts/FansNum.otf#FansNum</FontFamily>
</ResourceDictionary>
</Application.Resources>

Expand Down
40 changes: 14 additions & 26 deletions src/BiliLite.UWP/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
using System.Threading.Tasks;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.ApplicationModel.Core;
using Windows.Foundation;
using Windows.Graphics.Display;
using Windows.UI;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
Expand Down Expand Up @@ -200,12 +196,20 @@ private async void InitBili()
{
//如果屏幕分辨率大于16:9,设置为List
SettingService.SetValue<int>(SettingConstants.UI.RECMEND_DISPLAY_MODE, 1);
// // 当导航堆栈尚未还原时,导航到第一页,
// // 并通过将所需信息作为导航参数传入来配置参数
// bool loadState = args.PreviousExecutionState == ApplicationExecutionState.Terminated;
// ExtendedSplash extendedSplash = new(args.SplashScreen, loadState);
// rootFrame.Content = extendedSplash;
// Window.Current.Content = rootFrame;
// await Task.Delay(200); // 防止初始屏幕闪烁
}
}
//圆角
App.Current.Resources["ImageCornerRadius"] = new CornerRadius(SettingService.GetValue<double>(SettingConstants.UI.IMAGE_CORNER_RADIUS, 0));
await AppHelper.SetRegions();
await InitDb();

try
{
var downloadService = ServiceProvider.GetRequiredService<DownloadService>();
Expand All @@ -217,6 +221,9 @@ private async void InitBili()
logger.Error("初始化加载下载视频错误", ex);
}
VideoPlayHistoryHelper.LoadABPlayHistories(true);

//var pluginService = ServiceProvider.GetRequiredService<PluginService>();
//await pluginService.Start();
}

private async Task InitDb()
Expand Down Expand Up @@ -250,28 +257,9 @@ private void OnSuspending(object sender, SuspendingEventArgs e)

public static void ExtendAcrylicIntoTitleBar()
{
UISettings uISettings = new UISettings();
CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;
ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;
titleBar.ButtonBackgroundColor = Colors.Transparent;
titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;
titleBar.ButtonForegroundColor = TitltBarButtonColor(uISettings);
uISettings.ColorValuesChanged += new TypedEventHandler<UISettings, object>((setting, args) =>
{
titleBar.ButtonForegroundColor = TitltBarButtonColor(setting);
});
}
private static Color TitltBarButtonColor(UISettings uISettings)
{
var settingTheme = SettingService.GetValue<int>(SettingConstants.UI.THEME, 0);
var uiSettings = new Windows.UI.ViewManagement.UISettings();
var color = uiSettings.GetColorValue(UIColorType.Foreground);
if (settingTheme != 0)
{
color = settingTheme == 1 ? Colors.Black : Colors.White;
}
return color;
AppExtensions.HandleTitleTheme();
}

protected override void OnActivated(IActivatedEventArgs args)
{
base.OnActivated(args);
Expand Down Expand Up @@ -300,4 +288,4 @@ private void RegisterService()
}
}
}
}
}
Binary file modified src/BiliLite.UWP/Assets/SplashScreen.scale-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/BiliLite.UWP/Assets/SplashScreen.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/BiliLite.UWP/Assets/SplashScreen.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/BiliLite.UWP/Assets/SplashScreen.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/BiliLite.UWP/Assets/SplashScreen.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 41 additions & 6 deletions src/BiliLite.UWP/BiliLite.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
<Compile Include="Dialogs\SendDynamicV2Dialog.xaml.cs">
<DependentUpon>SendDynamicV2Dialog.xaml</DependentUpon>
</Compile>
<Compile Include="Extensions\AppExtensions.cs" />
<Compile Include="Extensions\BizServicesExtensions.cs" />
<Compile Include="Extensions\ControlsExtensions.cs" />
<Compile Include="Extensions\FileExtensions.cs" />
Expand Down Expand Up @@ -262,22 +263,44 @@
<Compile Include="Models\Functions\ToggleFullWindowShortcutFunction.cs" />
<Compile Include="Models\Functions\ToggleMiniWindowShortcutFunction.cs" />
<Compile Include="Models\Functions\ToggleSubtitleShortcutFunction.cs" />
<Compile Include="Models\Common\Search\SearchAnimeItem.cs" />
<Compile Include="Models\Common\Search\SearchArea.cs" />
<Compile Include="Models\Common\Search\SearchArticleItem.cs" />
<Compile Include="Models\Common\Search\SearchLiveRoomItem.cs" />
<Compile Include="Models\Common\Search\SearchTopicItem.cs" />
<Compile Include="Models\Common\Search\SearchUserItem.cs" />
<Compile Include="Models\Common\Search\SearchUserOfficialVerifyItem.cs" />
<Compile Include="Models\Common\Search\SearchVideoItem.cs" />
<Compile Include="Pages\IScrollRecorablePage.cs" />
<Compile Include="Pages\Other\MarkdownViewerPage.xaml.cs">
<DependentUpon>MarkdownViewerPage.xaml</DependentUpon>
</Compile>
<Compile Include="Models\Common\Search\SearchParameter.cs" />
<Compile Include="Controls\DataTemplateSelectors\SearchDataTemplateSelector.cs" />
<Compile Include="Services\BiliLiteDbContext.cs" />
<Compile Include="Services\DownloadService.cs" />
<Compile Include="Services\PluginService.cs" />
<Compile Include="Services\SqlMigrateService.cs" />
<Compile Include="ViewModels\Common\MainPageViewModel.cs" />
<Compile Include="ViewModels\Common\PieControlViewModel.cs" />
<Compile Include="ViewModels\Search\BaseSearchPivotViewModel.cs" />
<Compile Include="ViewModels\Search\ISearchPivotViewModel.cs" />
<Compile Include="ViewModels\Search\SearchAnimeViewModel.cs" />
<Compile Include="ViewModels\Search\SearchArticleViewModel.cs" />
<Compile Include="ViewModels\Search\SearchLiveRoomViewModel.cs" />
<Compile Include="ViewModels\Search\SearchPageViewModel.cs" />
<Compile Include="ViewModels\Search\SearchTopicViewModel.cs" />
<Compile Include="ViewModels\Search\SearchUserViewModel.cs" />
<Compile Include="ViewModels\Search\SearchVideoViewModel.cs" />
<Compile Include="ViewModels\Plugins\WebSocketPluginViewModel.cs" />
<Compile Include="ViewModels\Settings\CDNServerItemViewModel.cs" />
<Compile Include="Pages\ISavablePage.cs" />
<Compile Include="Services\Biz\MediaListService.cs" />
<Compile Include="Services\ContentFilterService.cs" />
<Compile Include="Services\PlaySpeedMenuService.cs" />
<Compile Include="ViewModels\Comment\SendCommentDialogViewModel.cs" />
<Compile Include="ViewModels\Rank\RankRegionViewModel.cs" />
<Compile Include="ViewModels\Settings\DevSettingsControlViewModel.cs" />
<Compile Include="ViewModels\Settings\EditPlaySpeedMenuViewModel.cs" />
<Compile Include="ViewModels\Settings\FilterRuleViewModel.cs" />
<Compile Include="ViewModels\Settings\FilterSettingsViewModel.cs" />
Expand Down Expand Up @@ -723,7 +746,7 @@
</Compile>
<Compile Include="Converters\BooleanConvert.cs" />
<Compile Include="Converters\ColorConvert.cs" />
<Compile Include="Converters\ColorSelecteConvert.cs" />
<Compile Include="Converters\ColorSelectedConvert.cs" />
<Compile Include="Converters\CountOrTextConvert.cs" />
<Compile Include="Converters\DatetimeConvert.cs" />
<Compile Include="Converters\DisplayConvert.cs" />
Expand Down Expand Up @@ -782,7 +805,7 @@
<Compile Include="Modules\Player\Playurl\BiliPlayUrl.cs" />
<Compile Include="Models\Common\Video\PlayUrlInfos\BiliFlvPlayUrlInfo.cs" />
<Compile Include="Modules\RegionDetailVM.cs" />
<Compile Include="Modules\SearchVM.cs" />
<Compile Include="Models\Common\Search\SearchFilterItem.cs" />
<Compile Include="Modules\Season\SeasonRankVM.cs" />
<Compile Include="Modules\Season\SeasonReviewVM.cs" />
<Compile Include="Modules\User\Account.cs" />
Expand Down Expand Up @@ -937,7 +960,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Models\Requests\ApiModel.cs" />
<Compile Include="Models\Common\ApiKeyInfo.cs" />
<Compile Include="Services\SearchService.cs" />
<Compile Include="Services\Biz\SearchService.cs" />
<Compile Include="ViewModels\Common\BaseViewModel.cs" />
<Compile Include="ViewModels\Download\DownloadDialogViewModel.cs" />
<Compile Include="Models\Common\Video\VideoListItem.cs" />
Expand Down Expand Up @@ -1430,17 +1453,25 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Dark.xaml">
<Page Include="Styles\TextBlockStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Light.xaml">
<Page Include="Themes\Breakpoint.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Themes\Colors.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Themes\Pink.xaml">
<Page Include="Themes\Converter.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Themes\Fonts.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -1549,6 +1580,9 @@
<PackageReference Include="Tomlyn">
<Version>0.17.0</Version>
</PackageReference>
<PackageReference Include="WebSocket4Net">
<Version>0.15.2</Version>
</PackageReference>
<PackageReference Include="Win2D.uwp">
<Version>1.26.0</Version>
</PackageReference>
Expand All @@ -1575,6 +1609,7 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Assets\Tools\" />
<Folder Include="Models\Plugins\" />
<Folder Include="Models\Requests\Api\Grpc\" />
<Folder Include="Modules\User\SendDynamic\" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/BiliLite.UWP/Controls/AttentionButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
Padding="16 4"
BorderThickness="1"
Background="Transparent"
BorderBrush="{ThemeResource HighLightColor}"
Foreground="{ThemeResource HighLightColor}"
BorderBrush="{ThemeResource SystemAccentColor}"
Foreground="{ThemeResource SystemAccentColor}"
FontSize="12">关注</Button>
</Grid>
</UserControl>
Loading

0 comments on commit f7dbb70

Please sign in to comment.