Skip to content

Commit

Permalink
统一化资源文件
Browse files Browse the repository at this point in the history
  • Loading branch information
Miaoyww committed Jul 22, 2024
1 parent c986e28 commit 2d08b37
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 11 deletions.
5 changes: 4 additions & 1 deletion NonsPlayer/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public App()
services.AddSingleton<ControlService>();
services.AddSingleton<PlayCounterService>();
services.AddSingleton<SMTCService>();
services.AddSingleton<RadioService>();
// Core Services
services.AddSingleton<IFileService, FileService>();
Expand Down Expand Up @@ -109,6 +110,9 @@ public App()
services.AddTransient<TodayDurationCardViewModel>();
services.AddTransient<TotalListenCardViewModel>();
services.AddTransient<RecentlyPlayItemCardViewModel>();
services.AddTransient<RecommendedPlaylistCardViewModel>();
services.AddTransient<RadioCardViewModel>();
#endregion
Expand Down Expand Up @@ -158,7 +162,6 @@ protected override async void OnLaunched(LaunchActivatedEventArgs args)
base.OnLaunched(args);
// App.GetService<IAppNotificationService>().Show(string.Format("AppNotificationSamplePayload".GetLocalized(), AppContext.BaseDirectory));
await GetService<IActivationService>().ActivateAsync(args);

}
}

Expand Down
2 changes: 1 addition & 1 deletion NonsPlayer/Components/Views/Home/GreetingsCard.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:winUi="using:CommunityToolkit.WinUI"
mc:Ignorable="d">
<Border Background="#F5F3F2"
<Border Background="{StaticResource ComponentsCardBackground}"
CornerRadius="20">
<Grid Grid.Row="0" Margin="20">
<TextBlock FontWeight="Bold" FontSize="30"
Expand Down
2 changes: 1 addition & 1 deletion NonsPlayer/Components/Views/Home/HitokotoCard.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:winUi="using:CommunityToolkit.WinUI"
mc:Ignorable="d">
<Border Background="#F5F3F2"
<Border Background="{StaticResource ComponentsCardBackground}"
CornerRadius="20">
<Grid Grid.Row="0" Margin="20">
<Grid.ColumnDefinitions>
Expand Down
2 changes: 1 addition & 1 deletion NonsPlayer/Components/Views/Home/TodayDurationCard.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:winUi="using:CommunityToolkit.WinUI"
mc:Ignorable="d">
<Border Background="#F5F3F2"
<Border Background="{StaticResource ComponentsCardBackground}"
CornerRadius="20">
<Grid Margin="20">
<StackPanel VerticalAlignment="Top" HorizontalAlignment="Center">
Expand Down
2 changes: 1 addition & 1 deletion NonsPlayer/Components/Views/Home/TotalListenCard.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:winUi="using:CommunityToolkit.WinUI"
mc:Ignorable="d">
<Border Background="#F5F3F2"
<Border Background="{StaticResource ComponentsCardBackground}"
CornerRadius="20">
<Grid Grid.Row="0" Margin="20">
<Grid.ColumnDefinitions>
Expand Down
8 changes: 4 additions & 4 deletions NonsPlayer/Helpers/CacheHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,26 +112,26 @@ public static async Task<ImageBrush> UpdateImageBrushAsync(string cacheId, strin
})).Data;
}

// public static async Task<Playlist> GetPlaylistAsync(string cacheId, string id)
// public static async Task<Music> GetPlaylistAsync(string cacheId, string id)
// {
// return (await GetCacheItemAsync(cacheId, async () =>
// await PlaylistAdaptes.CreateById(long.Parse(id)))).Data;
// }
//
// public static Playlist GetPlaylistCard(string cacheId, JObject item)
// public static Music GetPlaylistCard(string cacheId, JObject item)
// {
// return GetCacheItem(cacheId, () => PlaylistAdaptes.CreateFromRecommend(item)).Data;
// }
//
// public static async Task<Playlist> UpdatePlaylistAsync(string cacheId, string id)
// public static async Task<Music> UpdatePlaylistAsync(string cacheId, string id)
// {
// var playlist = (await UpdateCacheItem(cacheId, async () =>
// await PlaylistAdaptes.CreateById(long.Parse(id)))).Data;
// await UpdateImageBrushAsync(playlist.CacheAvatarId, playlist.AvatarUrl);
// return playlist;
// }
//
// public static Playlist GetPlaylist(string cacheId, string id)
// public static Music GetPlaylist(string cacheId, string id)
// {
// return GetCacheItemAsync(cacheId, async () =>
// await PlaylistAdaptes.CreateById(long.Parse(id))).Result.Data;
Expand Down
5 changes: 5 additions & 0 deletions NonsPlayer/NonsPlayer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
<None Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<Page Update="Components\Views\RadioCard.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
<SubType>Designer</SubType>
</Page>
<Page Update="Components\Views\RecommendedPlaylistCard.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
<SubType>Designer</SubType>
Expand Down Expand Up @@ -172,6 +176,7 @@
<None Remove="Components\Views\Home\RecentlyPlayItemCard.xaml" />
<None Remove="Components\Views\Home\TodayDurationCard.xaml" />
<None Remove="Components\Views\Home\TotalListenCard.xaml" />
<None Remove="Components\Views\RadioCard.xaml" />
<Content Include="Segoe Fluent Icons.ttf" />
</ItemGroup>

Expand Down
2 changes: 2 additions & 0 deletions NonsPlayer/Styles/Resource.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
<Thickness x:Key="PageContentCommonMargin">80,20,40,80</Thickness>
<Thickness x:Key="PlaylistDetailMargin">45,80,45,100</Thickness>
<SolidColorBrush x:Key="CommonTextColor">#3D3D3D</SolidColorBrush>
<SolidColorBrush x:Key="LightTextColor">#FFFFFF</SolidColorBrush>
<SolidColorBrush x:Key="ComponentsCardBackground">#F5F3F2</SolidColorBrush>
</ResourceDictionary>
5 changes: 3 additions & 2 deletions NonsPlayer/Views/ShellPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@
<Grid Grid.Column="3" Margin="10,0,140,0" HorizontalAlignment="Right">
<StackPanel Orientation="Horizontal">
<Button Name="SettingsButton"
Width="30" Height="30" Padding="0" Margin="5,0,0,0"
Width="20" Height="20"
Padding="0" Margin="10,0,0,20"
BorderThickness="0" Background="Transparent">
<FontIcon Glyph="&#xE713;" FontSize="18" />
<FontIcon Glyph="&#xE713;" FontSize="14" />
</Button>
</StackPanel>
</Grid>
Expand Down

0 comments on commit 2d08b37

Please sign in to comment.