Skip to content

Commit

Permalink
Merge pull request #79 from ywmoyue/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ywmoyue authored May 7, 2023
2 parents 26abc69 + 1c0e6d5 commit b7a2f76
Show file tree
Hide file tree
Showing 187 changed files with 4,006 additions and 8,013 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ https://app.bilibili.com/

# BiliLite

从逍遥橙子大佬那fork出来,大佬不维护了,群也解散了,要维护只能自己搞了
> BiliBili第三方UWP客户端
从逍遥橙子大佬那fork出来

https://github.com/xiaoyaocz/biliuwp-lite

Expand Down
6 changes: 3 additions & 3 deletions document/new_version.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "4.5.6",
"version_num": 40506,
"version_desc": "更新内容:\r\n\r\n* 支持忽略更新版本\r\n\r\n\r\n 如果无法打开下载地址,请访问:https://github.com/ywmoyue/biliuwp-lite/releases",
"version": "4.6.0",
"version_num": 40600,
"version_desc": "更新内容:\r\n\r\n* 视频评论区支持查看图片\r\n\r\n* 更新WinUI版本至2.8.3\r\n\r\n* 优化简繁体转换实现方式\r\n\r\n* 修复评论区无IP属地显示\r\n\r\n* 修复查询用户资料及投稿509错误\r\n\r\n\r\n 如果无法打开下载地址,请访问:https://github.com/ywmoyue/biliuwp-lite/releases",
"url": "https://github.com/ywmoyue/biliuwp-lite/releases",
"download_url": "https://github.com/ywmoyue/biliuwp-lite/releases"
}
2 changes: 1 addition & 1 deletion src/BiliLite.Packages/BiliLite.Packages.wapproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<PropertyGroup>
<ProjectGuid>64b1ce94-6533-489a-94d4-a7152e3be03f</ProjectGuid>
<TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
<DefaultLanguage>zh-CN</DefaultLanguage>
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
<NoWarn>$(NoWarn);NU1702</NoWarn>
Expand Down
2 changes: 1 addition & 1 deletion src/BiliLite.Packages/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Identity
Name="5422.502643927C6AD"
Publisher="CN=muyan"
Version="4.5.6.0" />
Version="4.6.0.0" />
<mp:PhoneIdentity PhoneProductId="8bceed6a-7e89-4141-a693-923401d5b2ac" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

<Properties>
Expand Down
302 changes: 198 additions & 104 deletions src/BiliLite.UWP/App.xaml

Large diffs are not rendered by default.

48 changes: 19 additions & 29 deletions src/BiliLite.UWP/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
using BiliLite.Extensions;
using BiliLite.Helpers;
using BiliLite.Models.Common;
using BiliLite.Models.Events;
using BiliLite.Modules;
using BiliLite.Services;
using FFmpegInteropX;
using Microsoft.Toolkit.Uwp.Helpers;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.ApplicationModel.Core;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Graphics.Display;
using Windows.Storage;
using Windows.UI;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace BiliLite
Expand All @@ -52,6 +41,7 @@ public App()
FFmpegInteropLogging.SetLogProvider(this);
SqlHelper.InitDB();
LogService.Init();
OpenCCNET.ZhConverter.Initialize();
this.Suspending += OnSuspending;
}
private void RegisterExceptionHandlingSynchronizationContext()
Expand All @@ -66,7 +56,7 @@ private void SynchronizationContext_UnhandledException(object sender, AysncUnhan
try
{
logger.Log("程序运行出现错误", LogType.ERROR, e.Exception);
Utils.ShowMessageToast("程序出现一个错误,已记录");
Notify.ShowMessageToast("程序出现一个错误,已记录");
}
catch (Exception)
{
Expand All @@ -78,7 +68,7 @@ private void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExce
try
{
logger.Log("程序运行出现错误", LogType.ERROR, e.Exception);
Utils.ShowMessageToast("程序出现一个错误,已记录");
Notify.ShowMessageToast("程序出现一个错误,已记录");
}
catch (Exception)
{
Expand All @@ -97,13 +87,13 @@ public void Log(LogLevel level, string message)
/// <param name="e">有关启动请求和过程的详细信息。</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Navigation(e.Arguments,e.PrelaunchActivated);

Navigation(e.Arguments, e.PrelaunchActivated);

}


private async void Navigation(object arguments, bool prelaunch=false)
private async void Navigation(object arguments, bool prelaunch = false)
{
// We don't have ARM64 support of SYEngine.
if (RuntimeInformation.ProcessArchitecture != Architecture.Arm64)
Expand All @@ -119,7 +109,7 @@ private async void Navigation(object arguments, bool prelaunch=false)
catch (Exception)
{
}

InitBili();
Frame rootFrame = Window.Current.Content as Frame;

Expand All @@ -132,9 +122,9 @@ private async void Navigation(object arguments, bool prelaunch=false)

rootFrame.NavigationFailed += OnNavigationFailed;


//主题颜色
rootFrame.RequestedTheme = (ElementTheme)SettingHelper.GetValue<int>(SettingHelper.UI.THEME, 0);
rootFrame.RequestedTheme = (ElementTheme)SettingService.GetValue<int>(SettingConstants.UI.THEME, 0);

// 将框架放在当前窗口中
Window.Current.Content = rootFrame;
Expand All @@ -148,7 +138,7 @@ private async void Navigation(object arguments, bool prelaunch=false)
// 并通过将所需信息作为导航参数传入来配置
// 参数

var mode = SettingHelper.GetValue<int>(SettingHelper.UI.DISPLAY_MODE, 0);
var mode = SettingService.GetValue<int>(SettingConstants.UI.DISPLAY_MODE, 0);
if (mode == 0)
{
rootFrame.Navigate(typeof(MainPage), arguments);
Expand All @@ -162,9 +152,9 @@ private async void Navigation(object arguments, bool prelaunch=false)
{
if (arguments != null && !string.IsNullOrEmpty(arguments.ToString()))
{
await MessageCenter.HandelUrl(arguments.ToString());
await MessageCenter.HandelUrl(arguments.ToString());
}

}
// 确保当前窗口处于活动状态
Window.Current.Activate();
Expand All @@ -181,11 +171,11 @@ private async void InitBili()
if (display.ScreenWidthInRawPixels >= 1920 && (display.ScreenWidthInRawPixels / display.ScreenHeightInRawPixels > 16 / 9))
{
//如果屏幕分辨率大于16:9,设置为List
SettingHelper.SetValue<int>(SettingHelper.UI.RECMEND_DISPLAY_MODE, 1);
SettingService.SetValue<int>(SettingConstants.UI.RECMEND_DISPLAY_MODE, 1);
}
}
//圆角
App.Current.Resources["ImageCornerRadius"] = new CornerRadius(SettingHelper.GetValue<double>(SettingHelper.UI.IMAGE_CORNER_RADIUS, 0));
App.Current.Resources["ImageCornerRadius"] = new CornerRadius(SettingService.GetValue<double>(SettingConstants.UI.IMAGE_CORNER_RADIUS, 0));
await AppHelper.SetRegions();
DownloadVM.Instance.LoadDownloading();
DownloadVM.Instance.LoadDownloaded();
Expand Down Expand Up @@ -230,7 +220,7 @@ public static void ExtendAcrylicIntoTitleBar()
}
private static Color TitltBarButtonColor(UISettings uISettings)
{
var settingTheme = SettingHelper.GetValue<int>(SettingHelper.UI.THEME, 0);
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)
Expand All @@ -242,13 +232,13 @@ private static Color TitltBarButtonColor(UISettings uISettings)
protected override void OnActivated(IActivatedEventArgs args)
{
base.OnActivated(args);

if (args.Kind == ActivationKind.Protocol)
{
ProtocolActivatedEventArgs eventArgs = args as ProtocolActivatedEventArgs;
Navigation(eventArgs.Uri.AbsoluteUri ,false);
Navigation(eventArgs.Uri.AbsoluteUri, false);
}

}

}
Expand Down
29 changes: 22 additions & 7 deletions src/BiliLite.UWP/BiliLite.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<LangVersion>8.0</LangVersion>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.19041.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
Expand Down Expand Up @@ -129,11 +129,21 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="Extensions\ApiModelExtensions.cs" />
<Compile Include="Extensions\BiliExtensions.cs" />
<Compile Include="Extensions\ExceptionExtensions.cs" />
<Compile Include="Extensions\HttpCookieItemsExtensions.cs" />
<Compile Include="Extensions\HttpResultsExtensions.cs" />
<Compile Include="Extensions\Notify.cs" />
<Compile Include="Extensions\ObjectExtensions.cs" />
<Compile Include="Extensions\ObservableCollectionExtension.cs" />
<Compile Include="Extensions\StreamExtensions.cs" />
<Compile Include="Extensions\StringExtensions.cs" />
<Compile Include="Extensions\TaskExtensions.cs" />
<Compile Include="Extensions\TimeExtensions.cs" />
<Compile Include="Models\Common\SettingConstants.cs" />
<Compile Include="Models\Responses\NewVersionResponse.cs" />
<Compile Include="Models\Common\NavigationInfo.cs" />
<Compile Include="Models\Common\NotePicture.cs" />
<Compile Include="Models\Responses\HttpResults.cs" />
<Compile Include="Models\Events\AysncUnhandledExceptionEventArgs.cs" />
<Compile Include="Models\Download\DownloadSaveEpisodeInfo.cs" />
Expand All @@ -142,7 +152,6 @@
<Compile Include="Models\Download\DownloadUrlInfo.cs" />
<Compile Include="Models\Download\DownloadGUIDInfo.cs" />
<Compile Include="Models\Download\DownloadInfo.cs" />
<Compile Include="Models\Common\ChineseDictionary.cs" />
<Compile Include="Models\Common\CustomizedErrorException.cs" />
<Compile Include="Models\Common\Subtitle.cs" />
<Compile Include="Models\Requests\Api\AccountApi.cs" />
Expand Down Expand Up @@ -283,10 +292,9 @@
<Compile Include="Services\ILogger.cs" />
<Compile Include="Services\LogService.cs" />
<Compile Include="Services\MessageCenter.cs" />
<Compile Include="Helpers\SettingHelper.cs" />
<Compile Include="Helpers\SqlHelper.cs" />
<Compile Include="Helpers\Utils.cs" />
<Compile Include="Helpers\VideoPlayHistoryHelper.cs" />
<Compile Include="Services\SettingService.cs" />
<Compile Include="Services\SqlHelper.cs" />
<Compile Include="Services\VideoPlayHistoryHelper.cs" />
<Compile Include="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -624,6 +632,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\TabViewStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Dialogs\CommentDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -904,7 +916,7 @@
<Version>6.1.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.UI.Xaml">
<Version>2.3.200213001</Version>
<Version>2.8.3</Version>
</PackageReference>
<PackageReference Include="NLog">
<Version>4.7.5</Version>
Expand All @@ -915,6 +927,9 @@
<PackageReference Include="NSDanmaku">
<Version>2.0.3</Version>
</PackageReference>
<PackageReference Include="OpenCCNET">
<Version>1.0.2</Version>
</PackageReference>
<PackageReference Include="RestSharp">
<Version>107.3.0</Version>
</PackageReference>
Expand Down
3 changes: 1 addition & 2 deletions src/BiliLite.UWP/Controls/Carousel/Carousel.Manipulation.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using BiliLite.Helpers;
using System;
using System;

using Windows.UI.Xaml.Input;

Expand Down
1 change: 0 additions & 1 deletion src/BiliLite.UWP/Controls/Carousel/Carousel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Controls;
using Windows.Foundation;
using BiliLite.Helpers;

namespace BiliLite.Controls
{
Expand Down
28 changes: 25 additions & 3 deletions src/BiliLite.UWP/Controls/CommentControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,33 @@
<Run Text="{x:Bind Path=content.plat_str}"></Run>
<Run Text="{x:Bind Path=reply_control.location}"></Run>
</TextBlock>

<ContentControl Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" Margin="4 0" Content="{x:Bind Path=content.text}">

</ContentControl>
<Grid Margin="0 8 0 0" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="3">
<toolkit:AdaptiveGridView
Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2"
x:Name="NotePicturesView"
StretchContentForSingleRow="False"
OneRowModeEnabled="True"
ItemHeight="80"
ItemsSource="{x:Bind Path=content.pictures}"
SelectionMode="None"
ItemClick="NotePicturesView_ItemClick"
IsItemClickEnabled="True">
<toolkit:AdaptiveGridView.ItemTemplate>
<DataTemplate>
<Grid
Background="Transparent">
<Image
Source="{Binding ImgSrc}"
Stretch="UniformToFill"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
</DataTemplate>
</toolkit:AdaptiveGridView.ItemTemplate>
</toolkit:AdaptiveGridView>
<Grid Margin="0 8 0 0" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="4">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">

<HyperlinkButton Click="btn_Like_Click" Foreground="{x:Bind LikeColor,Mode=OneWay}" Margin="4 0 8 0" HorizontalContentAlignment="Left">
Expand Down Expand Up @@ -214,7 +236,7 @@
</Border>
</Grid>

<StackPanel Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="2" Margin="0 4" Background="#19AAAAAA" Padding="8" Visibility="{x:Bind Path=showReplies,Mode=OneWay}">
<StackPanel Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="2" Margin="0 4" Background="#19AAAAAA" Padding="8" Visibility="{x:Bind Path=showReplies,Mode=OneWay}">

<StackPanel Visibility="{x:Bind Path=showReplyBox,Mode=OneWay}" Margin="0 0 0 4">
<TextBox MaxLength="233" BorderThickness="0" TextWrapping="Wrap" Text="{x:Bind Path=replyText,Mode=TwoWay}" FontSize="14" MinHeight="48" PlaceholderText="说点什么吧..." AcceptsReturn="True"></TextBox>
Expand Down
Loading

0 comments on commit b7a2f76

Please sign in to comment.