Skip to content

Commit

Permalink
remove clutter from seasonal page
Browse files Browse the repository at this point in the history
  • Loading branch information
insomniachi committed Aug 8, 2023
1 parent 8d05547 commit 4455f94
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
3 changes: 2 additions & 1 deletion Totoro.Core/ViewModels/UserListViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,11 @@ public UserListViewModel(ITrackingServiceContext trackingService,
.ToPropertyEx(this, x => x.IsListView);

Observable.Timer(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1))
.Where(_ => Mode == DisplayMode.Grid)
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(_ =>
{
foreach (var item in Anime)
foreach (var item in Anime.Where(x => x.NextEpisodeAt is not null))
{
item.RaisePropertyChanged(nameof(item.NextEpisodeAt));
}
Expand Down
37 changes: 24 additions & 13 deletions Totoro.WinUI/UserControls/AnimeCard.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:ctk="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:help="using:Totoro.WinUI.Helpers"
xmlns:labs="using:CommunityToolkit.Labs.WinUI"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:root="using:Totoro.WinUI"
xmlns:uc="using:Totoro.WinUI.UserControls"
Expand Down Expand Up @@ -168,14 +169,18 @@
<uc:ImageEx
Grid.Column="0"
CacheMode="BitmapCache"
CornerRadius="5 0 0 5"
EnableLazyLoading="True"
IsCacheEnabled="True"
PlaceholderSource="/Assets/placeholder.jpg"
PlaceholderStretch="Fill"
Source="{x:Bind Anime.Image, Mode=OneWay}"
Stretch="UniformToFill" />

<Grid Grid.Column="1" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid
Grid.Column="1"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
CornerRadius="0 5 5 0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
Expand Down Expand Up @@ -218,22 +223,27 @@

<ItemsControl
Grid.Row="1"
Margin="0,0,0,5"
ItemsSource="{x:Bind GetAdditionalInformation(Anime), Mode=OneWay}">
Margin="{StaticResource SmallTopMargin}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
ItemsSource="{x:Bind Anime.Genres, Mode=OneWay}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<uc:UniformGrid Margin="{StaticResource XXSmallLeftTopRightBottomMargin}" Columns="2">
<TextBlock Margin="{StaticResource SmallLeftMargin}" FontWeight="Bold">
<Run Text="{Binding Key}" />
</TextBlock>
<TextBlock
Margin="{StaticResource SmallRightMargin}"
Text="{Binding Value}"
TextTrimming="WordEllipsis"
ToolTipService.ToolTip="{Binding Value}" />
</uc:UniformGrid>
<Border
Margin="5"
Padding="20,5"
Background="{ThemeResource AccentAcrylicInAppFillColorDefaultBrush}"
BorderBrush="Black"
CornerRadius="12">
<TextBlock Text="{Binding}" />
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<labs:WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>

<ScrollViewer
Expand All @@ -242,6 +252,7 @@
Padding="10">
<TextBlock Text="{x:Bind Anime.Description, Mode=OneWay}" TextWrapping="WrapWholeWords" />
</ScrollViewer>

</Grid>


Expand Down

0 comments on commit 4455f94

Please sign in to comment.