💄 Create "master" view (#2)
## "master" view The view for an individual album. ## Basic Navigation To make sure that we could do it, and to allow for more sophisticated manual testing, we also implemented basic navigation. Co-authored-by: Alexis DRAI <alexis.drai@etu.uca.fr> Reviewed-on: #2main
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="AMC.View.Controls.LibraryCategoryItem">
|
||||
|
||||
<StackLayout Orientation="Horizontal"
|
||||
Padding="8"
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource Background}, Dark={StaticResource BackgroundDark}}">
|
||||
<Image x:Name="IconImage"
|
||||
WidthRequest="24"
|
||||
HeightRequest="24"
|
||||
Margin="0, 0, 8, 0"
|
||||
HorizontalOptions="Start" />
|
||||
<Label x:Name="CategoryLabel"
|
||||
FontSize="16"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource PrimaryDark}}"
|
||||
HorizontalOptions="StartAndExpand" />
|
||||
<Image Source="icon_chevron_right.png"
|
||||
WidthRequest="24"
|
||||
HeightRequest="24"
|
||||
Margin="8, 0, 0, 0"
|
||||
HorizontalOptions="End" />
|
||||
</StackLayout>
|
||||
|
||||
</ContentView>
|
@ -1,12 +0,0 @@
|
||||
<?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"
|
||||
x:Class="AMC.View.MainPage">
|
||||
|
||||
<Button
|
||||
x:Name="RdmBtn"
|
||||
Text="DO IT"
|
||||
Clicked="OnRdmBtnClicked"
|
||||
/>
|
||||
|
||||
</ContentPage>
|
After Width: | Height: | Size: 6.1 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 9.9 KiB |
After Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 112 KiB |
After Width: | Height: | Size: 414 KiB |
After Width: | Height: | Size: 125 KiB |
After Width: | Height: | Size: 251 KiB |
@ -0,0 +1,87 @@
|
||||
<?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">
|
||||
|
||||
<ScrollView
|
||||
Padding="0, 0, 0, 128"
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource Background}, Dark={StaticResource BackgroundDark}}">
|
||||
<StackLayout Spacing="8">
|
||||
<Label Text="{x:Static strings:Strings.LibraryTitle}"
|
||||
FontSize="32"
|
||||
FontAttributes="Bold"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource PrimaryDark}}"
|
||||
Margin="8" />
|
||||
|
||||
<StackLayout Orientation="Vertical" Spacing="0">
|
||||
<ctl:LibraryCategoryItem
|
||||
CategoryText="{x:Static strings:Strings.PlaylistsCategory}"
|
||||
IconSource="icon_playlists.png" />
|
||||
<BoxView Style="{StaticResource GraySeparator}"/>
|
||||
|
||||
<ctl:LibraryCategoryItem
|
||||
CategoryText="{x:Static strings:Strings.ArtistsCategory}"
|
||||
IconSource="icon_artists.png" />
|
||||
<BoxView Style="{StaticResource GraySeparator}"/>
|
||||
|
||||
<ctl:LibraryCategoryItem
|
||||
CategoryText="{x:Static strings:Strings.AlbumsCategory}"
|
||||
IconSource="icon_albums.png" />
|
||||
<BoxView Style="{StaticResource GraySeparator}"/>
|
||||
|
||||
<ctl:LibraryCategoryItem
|
||||
CategoryText="{x:Static strings:Strings.SongsCategory}"
|
||||
IconSource="icon_songs.png" />
|
||||
<BoxView Style="{StaticResource GraySeparator}"/>
|
||||
|
||||
<ctl:LibraryCategoryItem
|
||||
CategoryText="{x:Static strings:Strings.GenresCategory}"
|
||||
IconSource="icon_genres.png" />
|
||||
<BoxView Style="{StaticResource GraySeparator}"/>
|
||||
|
||||
</StackLayout>
|
||||
|
||||
<Label Text="{x:Static strings:Strings.RecentlyAddedHeader}"
|
||||
FontSize="16"
|
||||
FontAttributes="Bold"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource PrimaryDark}}"
|
||||
Margin="8, 16, 8, 8" />
|
||||
|
||||
<CollectionView
|
||||
ItemsSource="{Binding Albums}"
|
||||
ItemsLayout="VerticalGrid, 2"
|
||||
SelectionMode="Single"
|
||||
SelectionChanged="OnAlbumSelected">
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:AlbumViewModel">
|
||||
<StackLayout Margin="16">
|
||||
<Border>
|
||||
<Border.StrokeShape>
|
||||
<RoundRectangle CornerRadius="8,8,8,8" />
|
||||
</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>
|
||||
</ContentPage>
|