Skip to content

Commit

Permalink
Improve UI
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry08 committed Nov 9, 2023
1 parent 8b886ab commit e5e637a
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 10 deletions.
2 changes: 1 addition & 1 deletion AniStream/Views/AnimeTabView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
VerticalOptions="Start"
WidthRequest="35">
<ImageButton.Behaviors>
<toolkit:IconTintColorBehavior TintColor="#D9FFFFFF" />
<toolkit:IconTintColorBehavior TintColor="#A9FFFFFF" />
</ImageButton.Behaviors>
</ImageButton>

Expand Down
45 changes: 36 additions & 9 deletions AniStream/Views/Templates/AnimeCarouselTemplateView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
xmlns:local="clr-namespace:AniStream"
xmlns:materialDesign="clr-namespace:MaterialDesign"
xmlns:models="clr-namespace:Jita.AniList.Models;assembly=Jita.AniList"
xmlns:viewTemplates="clr-namespace:AniStream.Views.Templates"
xmlns:views="clr-namespace:AniStream.Views"
x:Name="this"
Margin="0"
Padding="0"
Expand All @@ -16,6 +18,12 @@
<Border.Resources>
<ResourceDictionary>
<converters:RatingConverter x:Key="RatingConverter" />

<DataTemplate x:Key="GenreTemplate">
<viewTemplates:CarouselGenreTemplateView />
</DataTemplate>

<views:MainDataTemplateSelector x:Key="GenreTemplateSelector" DataTemplate="{StaticResource GenreTemplate}" />
</ResourceDictionary>
</Border.Resources>
<!-- Source="https://media.tenor.com/l47dR9-6BGIAAAAd/demon-slayer-kimetsu-no-yaiba.gif" -->
Expand Down Expand Up @@ -95,15 +103,34 @@
</Border>

<Grid Grid.Column="1">
<Label
Grid.Column="1"
FontAttributes="Bold"
FontSize="18"
HorizontalTextAlignment="Center"
LineBreakMode="TailTruncation"
MaxLines="5"
Text="{Binding Title.PreferredTitle}"
VerticalOptions="Center" />
<VerticalStackLayout Spacing="5" VerticalOptions="Center">
<Label
FontAttributes="Bold"
FontSize="18"
HorizontalTextAlignment="Center"
LineBreakMode="TailTruncation"
MaxLines="5"
Text="{Binding Title.PreferredTitle}"
VerticalOptions="Center" />

<Label
FontAttributes="Bold"
FontSize="14"
HorizontalTextAlignment="Center"
LineBreakMode="TailTruncation"
MaxLines="5"
Opacity="0.65"
Text="{Binding Status}"
TextColor="{StaticResource Secondary}"
VerticalOptions="Center" />

<FlexLayout
Margin="0,0,0,10"
BindableLayout.ItemTemplateSelector="{StaticResource GenreTemplateSelector}"
BindableLayout.ItemsSource="{Binding Genres}"
JustifyContent="Center"
Wrap="Wrap" />
</VerticalStackLayout>
</Grid>
</Grid>
</Grid>
Expand Down
33 changes: 33 additions & 0 deletions AniStream/Views/Templates/CarouselGenreTemplateView.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8" ?>
<Border
x:Class="AniStream.Views.Templates.CarouselGenreTemplateView"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:AniStream"
xmlns:models="clr-namespace:Juro.Core.Models.Anime;assembly=Juro.Core"
x:Name="this"
Margin="0"
Padding="0"
BackgroundColor="Transparent"
HeightRequest="35">
<Grid BackgroundColor="Transparent">
<Border
Grid.Column="0"
HorizontalOptions="Center"
StrokeThickness="1"
VerticalOptions="FillAndExpand">
<Border.StrokeShape>
<RoundRectangle CornerRadius="15" />
</Border.StrokeShape>
<Label
Grid.Row="1"
Padding="9,4"
FontAttributes="Bold"
FontSize="11"
HorizontalOptions="Center"
HorizontalTextAlignment="Center"
Text="{Binding}"
VerticalTextAlignment="Center" />
</Border>
</Grid>
</Border>
11 changes: 11 additions & 0 deletions AniStream/Views/Templates/CarouselGenreTemplateView.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Microsoft.Maui.Controls;

namespace AniStream.Views.Templates;

public partial class CarouselGenreTemplateView
{
public CarouselGenreTemplateView()
{
InitializeComponent();
}
}

0 comments on commit e5e637a

Please sign in to comment.