You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
4.8 KiB

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:AMC.View"
xmlns:strings="clr-namespace:AMC.View.Resources.Strings"
xmlns:conv="clr-namespace:AMC.View.Converters"
xmlns:ctl="clr-namespace:AMC.View.Controls"
xmlns:vm="clr-namespace:AMC.ViewModel.ViewModels;assembly=AMC.ViewModel"
x:Class="AMC.View.Views.LibraryPage"
x:DataType="vm:LibraryViewModel">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ScrollView Grid.Row="0"
BackgroundColor="{AppThemeBinding Light={StaticResource Background}, Dark={StaticResource BackgroundDark}}">
<StackLayout Spacing="{StaticResource SpaceXS}"
Margin="{StaticResource BottomSpaceLittle}">
<Label Text="{x:Static strings:Strings.LibraryTitle}"
FontSize="{StaticResource TitleFontSize}"
FontAttributes="Bold"
TextColor="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource PrimaryDark}}"
Margin="{StaticResource SpaceXS}" />
<StackLayout Orientation="Vertical" Spacing="0">
<ctl:LibraryCategoryItem CategoryText="{x:Static strings:Strings.PlaylistsCategory}"
IconSource="icon_categories_playlists.png" />
<BoxView Style="{StaticResource GraySeparator}"/>
<ctl:LibraryCategoryItem CategoryText="{x:Static strings:Strings.ArtistsCategory}"
IconSource="icon_categories_artists.png" />
<BoxView Style="{StaticResource GraySeparator}"/>
<ctl:LibraryCategoryItem CategoryText="{x:Static strings:Strings.AlbumsCategory}"
IconSource="icon_categories_albums.png" />
<BoxView Style="{StaticResource GraySeparator}"/>
<ctl:LibraryCategoryItem CategoryText="{x:Static strings:Strings.SongsCategory}"
IconSource="icon_categories_songs.png" />
<BoxView Style="{StaticResource GraySeparator}"/>
<ctl:LibraryCategoryItem CategoryText="{x:Static strings:Strings.GenresCategory}"
IconSource="icon_categories_genres.png" />
<BoxView Style="{StaticResource GraySeparator}"/>
</StackLayout>
<Label Text="{x:Static strings:Strings.RecentlyAddedHeader}"
FontSize="{StaticResource SubSubtitleFontSize}"
FontAttributes="Bold"
TextColor="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource PrimaryDark}}"
Margin="{StaticResource SpaceXS}" />
<CollectionView ItemsSource="{Binding Albums}"
ItemsLayout="VerticalGrid, 2"
SelectionMode="Single"
SelectionChanged="OnAlbumSelected">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="vm:AlbumViewModel">
<StackLayout Margin="{StaticResource SpaceS}">
<Border>
<Border.StrokeShape>
<RoundRectangle CornerRadius="{StaticResource SlightlyRoundedCorners}" />
</Border.StrokeShape>
<Image Source="{Binding CoverImage}"
Aspect="AspectFill" />
</Border>
<Label Text="{Binding Title}"
TextColor="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource PrimaryDark}}"
LineBreakMode="TailTruncation" />
<Label Text="{Binding Artist}"
TextColor="{StaticResource Gray}"
LineBreakMode="TailTruncation" />
</StackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</StackLayout>
</ScrollView>
<!-- TODO Insert this in a main layout of some sort...-->
<ctl:BottomBar Grid.Row="1" />
</Grid>
</ContentPage>