Skip to content

Commit

Permalink
Increased Stability
Browse files Browse the repository at this point in the history
- Fixed some bugs, which made the AnimeListView Crash
  • Loading branch information
CosmicPredator committed Sep 11, 2023
1 parent 926a197 commit fb683e1
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 48 deletions.
8 changes: 8 additions & 0 deletions src/AniMoe.App/AniMoe.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
<Page Remove="Constants\**" />
</ItemGroup>
<ItemGroup>
<None Remove="Assets\benner_2.jpg" />
<None Remove="Assets\emptyList.json" />
<None Remove="Assets\like-filled.svg" />
<None Remove="Assets\profile_banner.jpg" />
<None Remove="Assets\Window-Icon.ico" />
<None Remove="Controls\CharacterListView.xaml" />
<None Remove="Controls\CharacterViewControls\AnimeListControl.xaml" />
Expand Down Expand Up @@ -149,12 +151,18 @@
<Content Remove="Assets\profile.jpg" />
</ItemGroup>
<ItemGroup>
<Content Update="Assets\benner_2.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Update="Assets\emptyList.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="Assets\like-filled.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="Assets\profile_banner.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Update="Assets\SmallTile.scale-100.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand Down
8 changes: 4 additions & 4 deletions src/AniMoe.App/App.xaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- Copyright (c) Microsoft Corporation and Contributors. -->
<!-- Licensed under the MIT License. -->
<!-- Copyright (c) Microsoft Corporation and Contributors. -->
<!-- Licensed under the MIT License. -->

<Application
x:Class="AniMoe.App.App"
Expand All @@ -10,9 +10,9 @@
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<!-- Other merged dictionaries here -->
<!-- Other merged dictionaries here -->
</ResourceDictionary.MergedDictionaries>
<!-- Other app resources here -->
<!-- Other app resources here -->
<SolidColorBrush x:Key="WindowCaptionBackground">Transparent</SolidColorBrush>
<SolidColorBrush x:Key="WindowCaptionBackgroundDisabled">Transparent</SolidColorBrush>
<Thickness x:Key="NavigationViewContentMargin">0, 40, 0, 0</Thickness>
Expand Down
Binary file added src/AniMoe.App/Assets/benner_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/AniMoe.App/Assets/profile_banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 20 additions & 34 deletions src/AniMoe.App/Styles/LayoutStyles.xaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AniMoe.App.Styles">
<Style TargetType="StackPanel"
x:Key="CardStackPanelStyle">
<Setter Property="Background"
Value="{StaticResource CardBackgroundFillColorDefaultBrush}" />
<Setter Property="CornerRadius"
Value="4" />
<Setter Property="BorderBrush"
Value="{StaticResource ControlElevationBorderBrush}"/>
<Setter Property="BorderThickness"
Value="1"/>
<?xml version="1.0" encoding="utf-8" ?>
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AniMoe.App.Styles">
<Style x:Key="CardStackPanelStyle" TargetType="StackPanel">
<Setter Property="Background" Value="{StaticResource CardBackgroundFillColorDefaultBrush}" />
<Setter Property="CornerRadius" Value="4" />
<Setter Property="BorderBrush" Value="{StaticResource ControlElevationBorderBrush}" />
<Setter Property="BorderThickness" Value="1" />
</Style>
<Style TargetType="Grid"
x:Key="CardGridStyle">
<Setter Property="Background"
Value="{StaticResource CardBackgroundFillColorDefaultBrush}" />
<Setter Property="CornerRadius"
Value="4" />
<Setter Property="BorderBrush"
Value="{StaticResource ControlElevationBorderBrush}"/>
<Setter Property="BorderThickness"
Value="1"/>
<Style x:Key="CardGridStyle" TargetType="Grid">
<Setter Property="Background" Value="{StaticResource CardBackgroundFillColorDefaultBrush}" />
<Setter Property="CornerRadius" Value="4" />
<Setter Property="BorderBrush" Value="{StaticResource ControlElevationBorderBrush}" />
<Setter Property="BorderThickness" Value="1" />
</Style>
<Style TargetType="RelativePanel"
x:Key="CardRelativePanelStyle">
<Setter Property="Background"
Value="{StaticResource CardBackgroundFillColorDefaultBrush}" />
<Setter Property="CornerRadius"
Value="4" />
<Setter Property="BorderBrush"
Value="{StaticResource ControlElevationBorderBrush}"/>
<Setter Property="BorderThickness"
Value="1"/>
<Style x:Key="CardRelativePanelStyle" TargetType="RelativePanel">
<Setter Property="Background" Value="{StaticResource CardBackgroundFillColorDefaultBrush}" />
<Setter Property="CornerRadius" Value="4" />
<Setter Property="BorderBrush" Value="{StaticResource ControlElevationBorderBrush}" />
<Setter Property="BorderThickness" Value="1" />
</Style>
</ResourceDictionary>
2 changes: 1 addition & 1 deletion src/AniMoe.App/Views/AnimeListView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<converters:NullValueConverter x:Key="NullValConv" />
<converters:UntilEpochConverter x:Key="UntilConv" />
<converters:FormatEnumToNormalConverter x:Key="FormatConv" />
<toolkitConverters:BoolNegationConverter x:Key="InverseBoolConverter"/>
<toolkitConverters:BoolNegationConverter x:Key="InverseBoolConverter" />
</Page.Resources>
<Grid
x:Name="RootGrid"
Expand Down
90 changes: 87 additions & 3 deletions src/AniMoe.App/Views/UserView.xaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<Page
x:Class="AniMoe.App.Views.UserView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AniMoe.App.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:AniMoe.App.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:media="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:toolkit="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">

<Grid>
<Page.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ms-appx:///Styles/LayoutStyles.xaml" />
<ResourceDictionary Source="ms-appx:///CommunityToolkit.Labs.WinUI.SegmentedControl/Segmented/Segmented.xaml" />
</ResourceDictionary.MergedDictionaries>
<media:AcrylicBrush
x:Key="CustomAcrylicBrush"
FallbackColor="#FF008000"
TintColor="#FF0000FF"
TintLuminosityOpacity="0"
TintOpacity="0" />
</ResourceDictionary>
</Page.Resources>

<Grid Margin="30" ColumnSpacing="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.2*" />
<ColumnDefinition Width="3*" />
</Grid.ColumnDefinitions>

<ScrollViewer>
<Grid Grid.Column="0" RowSpacing="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid
Grid.Row="0"
Height="300"
Style="{StaticResource CardGridStyle}">
<Grid.Background>
<ImageBrush ImageSource="ms-appx:///Assets/benner_2.jpg" Stretch="Fill" />
</Grid.Background>
<Grid CornerRadius="4">
<Grid.Background>
<media:AcrylicBrush
TintColor="Transparent"
TintLuminosityOpacity="0"
TintOpacity="0" />
</Grid.Background>
<ScrollViewer>
<StackPanel
HorizontalAlignment="Center"
VerticalAlignment="Center"
Spacing="10">
<toolkit:ImageEx
Width="120"
CornerRadius="8"
Source="ms-appx:///Assets/profile.jpg" />
<TextBlock
Margin="20,0"
Style="{ThemeResource SubtitleTextBlockStyle}"
Text="TestAccountForAnimoe"
TextAlignment="Center"
TextWrapping="WrapWholeWords"
ToolTipService.ToolTip="TestAccountForAnimoe" />

<Border
Padding="10,5"
HorizontalAlignment="Center"
Background="{ThemeResource SystemAccentColor}"
CornerRadius="5">
<TextBlock
Foreground="{ThemeResource TextOnAccentAAFillColorPrimaryBrush}"
Text="ぴょんぴょん"
TextAlignment="Center" />
</Border>

<Button
HorizontalAlignment="Center"
Content="Following"
Style="{ThemeResource AccentButtonStyle}" />
</StackPanel>
</ScrollViewer>
</Grid>
</Grid>
<Grid Grid.Row="1" Style="{StaticResource CardGridStyle}"
Height="800"/>
</Grid>
</ScrollViewer>

<Grid Grid.Column="1" Style="{StaticResource CardGridStyle}" />

</Grid>
</Page>
6 changes: 0 additions & 6 deletions src/AniMoe.App/Views/UserView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,8 @@
using Windows.Foundation;
using Windows.Foundation.Collections;

// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.

namespace AniMoe.App.Views
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class UserView : Page
{
public UserView()
Expand Down

0 comments on commit fb683e1

Please sign in to comment.