💄 Modification de certains composants

master
Lucas EVARD 2 years ago
parent 6f1f436af2
commit ac35cbd296

@ -6,7 +6,7 @@
xmlns:local="clr-namespace:PocketBook"
Shell.FlyoutBehavior="Disabled"
Shell.NavBarIsVisible="False">
<TabBar>
<ShellContent Title="My Library" Icon="books_vertical_fill.svg" ContentTemplate="{DataTemplate local:MainPage}"/>
<ShellContent Title="My Lists" Icon="listbullet.svg" ContentTemplate="{DataTemplate local:MainPage}"/>

@ -0,0 +1,9 @@
<?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="PocketBook.BookChange">
<StackLayout Orientation="Horizontal" Margin="10,15,0,15">
<Image x:Name="imageName" WidthRequest="30" HeightRequest="30" />
<Label x:Name="propertyName" TextColor="{StaticResource Primary}" FontAttributes="Bold" VerticalOptions="Center" Margin="15,0,0,0"/>
</StackLayout>
</ContentView>

@ -0,0 +1,30 @@
namespace PocketBook;
public partial class BookChange : ContentView
{
public static readonly BindableProperty ImageNameProperty=
BindableProperty.Create(nameof(ImageName), typeof(string), typeof(BookChange), string.Empty);
public static readonly BindableProperty PropertyNameProperty =
BindableProperty.Create(nameof(PropertyName), typeof(string), typeof(BookChange), string.Empty);
public string ImageName
{
get { return (string)GetValue(ImageNameProperty); }
set { SetValue(ImageNameProperty, value); }
}
public string PropertyName
{
get { return (string)GetValue(PropertyNameProperty); }
set { SetValue(PropertyNameProperty, value); }
}
public BookChange()
{
InitializeComponent();
imageName.SetBinding(Image.SourceProperty, new Binding(nameof(ImageName), source: this));
propertyName.SetBinding(Label.TextProperty, new Binding(nameof(PropertyName), source: this));
}
}

@ -2,21 +2,18 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="PocketBook.BookDetail"
xmlns:local="clr-namespace:PocketBook"
Title="BookDetail">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackLayout Orientation="Vertical">
<!-- StackLayout Orientation="Vertical">
<StackLayout Grid.Row="0" Orientation="Horizontal" BackgroundColor="#F2F1F6" Padding="0,10,60,20">
<Image Source="chevron_left.svg" HorizontalOptions="Start"/>
<Label VerticalTextAlignment="Center" Text="Tous" FontAttributes="Bold" TextColor="{StaticResource Primary}" FontSize="15" Margin="5,0,0,0"/>
<Label Text="Détail du livre" FontAttributes="Bold" FontSize="18" VerticalTextAlignment="Center" HorizontalOptions="CenterAndExpand"/>
<Label Text="Détails du livre" FontAttributes="Bold" FontSize="18" VerticalTextAlignment="Center" HorizontalOptions="CenterAndExpand"/>
</StackLayout>
<Line BackgroundColor="#E6E6E6"/>
</StackLayout>
<ScrollView Grid.Row="1">
</StackLayout> -->
<ScrollView>
<StackLayout>
<StackLayout Orientation="Horizontal" Margin="15,0,0,20">
@ -25,13 +22,7 @@
<StackLayout Orientation="Vertical">
<Label x:Name="titreBook" FontAttributes="Bold" Margin="0,25,0,0"/>
<StackLayout Orientation="Horizontal" Margin="0,90,0,0">
<Image Source="star.svg" WidthRequest="20"/>
<Image Source="star.svg" WidthRequest="20"/>
<Image Source="star.svg" WidthRequest="20"/>
<Image Source="star.svg" WidthRequest="20"/>
<Image Source="star.svg" WidthRequest="20"/>
</StackLayout>
<Label Text="★★★★★" TextColor="#D1D1D1" Margin="0,90,0,0"/>
</StackLayout>
</StackLayout>
<StackLayout Margin="15,0,0,0">
@ -43,79 +34,61 @@
<Line BackgroundColor="#D0D0D2" />
<StackLayout Margin="10,10,0,10">
<Label Text="Auteur" FontSize="16" FontAttributes="Bold"/>
<Label x:Name="bookAuteur" FontSize="20" Margin="0,10,0,0"/>
<Label x:Name="bookAuteur" TextColor="#9D9D9D" FontSize="20" Margin="0,10,0,0"/>
</StackLayout>
<Line BackgroundColor="#D0D0D2" />
<StackLayout Margin="10,10,0,10">
<Label Text="Maison d'édition" FontSize="16" FontAttributes="Bold"/>
<Label x:Name="bookEdition" FontSize="20" Margin="0,10,0,0"/>
<Label x:Name="bookEdition" TextColor="#9D9D9D" FontSize="20" Margin="0,10,0,0"/>
</StackLayout>
<Line BackgroundColor="#D0D0D2" />
<StackLayout Margin="10,10,0,10">
<Label Text="Résumé" FontSize="16" FontAttributes="Bold"/>
<Label x:Name="bookResume" FontSize="13" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales viverra justo, nec rutrum ligula elementum vitae. Suspendisse sit amet mi nec nulla pretium vulputate. Nam pretium volutpat ante, at viverra ex elementum quis. Pellentesque egestas nisl ac enim sollicitudin blandit. Mauris id scelerisque augue. Curabitur dui nibh, convallis quis sagittis eu, pretium vel erat. Sed ut aliquet mi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum eget lacus quis nisl auctor semper. Vestibulum feugiat ut tortor vel ultrices.
<Label x:Name="bookResume" TextColor="#9D9D9D" FontSize="13" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales viverra justo, nec rutrum ligula elementum vitae. Suspendisse sit amet mi nec nulla pretium vulputate. Nam pretium volutpat ante, at viverra ex elementum quis. Pellentesque egestas nisl ac enim sollicitudin blandit. Mauris id scelerisque augue. Curabitur dui nibh, convallis quis sagittis eu, pretium vel erat. Sed ut aliquet mi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum eget lacus quis nisl auctor semper. Vestibulum feugiat ut tortor vel ultrices.
Curabitur tempus erat nec sapien aliquam venenatis. In ornare odio in lacus ornare finibus. Maecenas semper nulla non tortor gravida tincidunt ut ut arcu. Sed magna sem, semper quis justo vitae, lacinia laoreet ex. Curabitur at mauris a velit pharetra fringilla commodo non elit. Quisque sollicitudin, ipsum id dapibus consectetur, sapien tortor mattis lectus, vitae tempor nisl nisl sed ipsum. In in orci nec odio hendrerit posuere a vel libero." Margin="0,10,15,0"/>
</StackLayout>
<Line BackgroundColor="#D0D0D2" />
<StackLayout Margin="0,10,0,10">
<Label Text="Détails" FontSize="16" Margin="10,0,0,5" FontAttributes="Bold"/>
<Label Text="Détails" FontSize="14" Margin="10,0,0,5" FontAttributes="Bold"/>
<StackLayout Orientation="Horizontal">
<Label Text="Nombre de pages" Margin="10,0,0,5" FontSize="20"/>
<Label FontSize="20" x:Name="bookNbPages" HorizontalOptions="EndAndExpand" Margin="10,0,15,0"/>
<Label Text="Nombre de pages" TextColor="#9D9D9D" Margin="10,0,0,5" FontSize="18"/>
<Label FontSize="18" x:Name="bookNbPages" TextColor="#9D9D9D" HorizontalOptions="EndAndExpand" Margin="10,0,15,0"/>
</StackLayout>
<StackLayout Orientation="Horizontal">
<Label Text="Langue" Margin="10,0,0,5" FontSize="20"/>
<Label x:Name="bookLangue" FontSize="20" HorizontalOptions="EndAndExpand" Margin="10,0,15,0"/>
<Label Text="Langue" TextColor="#9D9D9D" Margin="10,0,0,5" FontSize="18"/>
<Label x:Name="bookLangue" FontSize="18" TextColor="#9D9D9D" HorizontalOptions="EndAndExpand" Margin="10,0,15,0"/>
</StackLayout>
<StackLayout Orientation="Horizontal" Margin="10,0,0,10">
<Label Text="ISBN" FontSize="20"/>
<Label x:Name="bookISBN" FontSize="20" HorizontalOptions="EndAndExpand" Margin="0,0,15,0"/>
<Label Text="ISBN" TextColor="#9D9D9D" FontSize="18"/>
<Label x:Name="bookISBN" TextColor="#9D9D9D" FontSize="18" HorizontalOptions="EndAndExpand" Margin="0,0,15,0"/>
</StackLayout>
<Line BackgroundColor="#D0D0D2"/>
<Label Text="Statut de lecture" FontSize="16" Margin="10,10,0,5" FontAttributes="Bold"/>
<Label Text="Statut de lecture" FontSize="14" Margin="10,10,0,5" FontAttributes="Bold"/>
<StackLayout Orientation="Horizontal">
<Label Text="Statut" Margin="10,0,0,5" FontSize="20"/>
<Label x:Name="bookStatus" FontSize="20" HorizontalOptions="EndAndExpand" Margin="0,0,15,0"/>
<Label Text="Statut" TextColor="#9D9D9D" Margin="10,0,0,5" FontSize="18"/>
<Label x:Name="bookStatus" TextColor="#9D9D9D" FontSize="18" HorizontalOptions="EndAndExpand" Margin="0,0,15,0"/>
</StackLayout>
<Line BackgroundColor="#D0D0D2"/>
<Label Text="Bibliothèque" FontSize="16" Margin="10,10,0,5" FontAttributes="Bold"/>
<Label Text="Bibliothèque" FontSize="14" Margin="10,10,0,5" FontAttributes="Bold"/>
<StackLayout Orientation="Horizontal">
<Label Text="Ajouté le" Margin="10,0,0,10" FontSize="20"/>
<Label x:Name="bookAdd" FontSize="20" HorizontalOptions="EndAndExpand" Margin="0,0,15,0"/>
<Label Text="Ajouté le" TextColor="#9D9D9D" Margin="10,0,0,10" FontSize="18"/>
<Label x:Name="bookAdd" TextColor="#9D9D9D" FontSize="18" HorizontalOptions="EndAndExpand" Margin="0,0,15,0"/>
</StackLayout>
<Line BackgroundColor="#D0D0D2"/>
<StackLayout Padding="50"/>
<Line BackgroundColor="#D0D0D2"/>
<StackLayout Orientation="Horizontal" Margin="10,15,0,15">
<Image Source="person.svg" WidthRequest="30" HeightRequest="30" />
<Label Text="Déplacer le livre" TextColor="{StaticResource Primary}" FontAttributes="Bold" VerticalOptions="Center" Margin="15,0,0,0"/>
</StackLayout>
<local:BookChange PropertyName="Déplacer le livre" ImageName="folder.svg"/>
<Line BackgroundColor="#D0D0D2"/>
<StackLayout Orientation="Horizontal" Margin="10,15,0,15">
<Image Source="person.svg" WidthRequest="30" HeightRequest="30" />
<Label Text="Ajouter à la liste à lire plus tard" TextColor="{StaticResource Primary}" FontAttributes="Bold" VerticalOptions="Center" Margin="15,0,0,0"/>
</StackLayout>
<local:BookChange PropertyName="Ajouter à la liste à lire plus tard" ImageName="plus_round.svg"/>
<Line BackgroundColor="#D0D0D2"/>
<StackLayout Orientation="Horizontal" Margin="10,15,0,15">
<Image Source="person.svg" WidthRequest="30" HeightRequest="30" />
<Label Text="Changer le statut de lecture" TextColor="{StaticResource Primary}" FontAttributes="Bold" VerticalOptions="Center" Margin="15,0,0,0"/>
</StackLayout>
<local:BookChange PropertyName="Changer le statut de lecture" ImageName="eyeglasses.svg"/>
<Line BackgroundColor="#D0D0D2"/>
<StackLayout Orientation="Horizontal" Margin="10,15,0,15">
<Image Source="person.svg" WidthRequest="30" HeightRequest="30" />
<Label Text="Prêter le livre" TextColor="{StaticResource Primary}" FontAttributes="Bold" VerticalOptions="Center" Margin="15,0,0,0"/>
</StackLayout>
<Line BackgroundColor="#D0D0D2"/>
<local:BookChange PropertyName="Prêter le livre" ImageName="person.svg"/>
</StackLayout>
</StackLayout>
</StackLayout>
</ScrollView>
</Grid>
</ContentPage>

@ -4,7 +4,14 @@ public partial class BookDetail : ContentPage
{
public BookDetail(Book book)
{
InitializeComponent();
InitializeComponent();
ToolbarItem item = new ToolbarItem
{
Text = "Add item",
IconImageSource = ImageSource.FromFile("add.png")
};
this.ToolbarItems.Add(item);
titreBook.Text = book.name;
bookAuteur.Text = book.auteur;
bookEdition.Text = "Fayard (2019)";

@ -56,6 +56,9 @@
<MauiXaml Update="Auteur.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="BookChange.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="BookDetail.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Svg Vector Icons : http://www.onlinewebfonts.com/icon -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 256 256" enable-background="new 0 0 256 256" xml:space="preserve">
<metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata>
<g><g><path fill="#000000" d="M228.7,47.4H101.4L90.4,30.1H27.3c-9.5,0-17.3,7.7-17.3,17.3v161.2c0,9.5,7.7,17.3,17.3,17.3h201.5c9.5,0,17.3-7.7,17.3-17.3V64.7C246,55.1,238.3,47.4,228.7,47.4z M234.5,208.6c0,3.2-2.6,5.8-5.8,5.8H27.3c-3.2,0-5.8-2.6-5.8-5.8V93.5c0-3.2,2.6-5.8,5.8-5.8h201.5c3.2,0,5.8,2.6,5.8,5.8V208.6z M234.5,76.2h-213V47.4c0-3.2,2.6-5.8,5.8-5.8h57.5l11.5,17.3h132.5c3.2,0,5.8,2.6,5.8,5.8L234.5,76.2L234.5,76.2z"/></g></g>
</svg>

After

Width:  |  Height:  |  Size: 917 B

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Svg Vector Icons : http://www.onlinewebfonts.com/icon -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 256 256" enable-background="new 0 0 256 256" xml:space="preserve">
<metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata>
<g><g><path fill="#000000" d="M128,246c-65.2,0-118-52.8-118-118C10,62.8,62.8,10,128,10c65.2,0,118,52.8,118,118C246,193.2,193.2,246,128,246z M128,25.7C71.5,25.7,25.7,71.5,25.7,128c0,56.5,45.8,102.3,102.3,102.3c56.5,0,102.3-45.8,102.3-102.3C230.3,71.5,184.5,25.7,128,25.7z M135.9,183.1h-15.7v-47.2H72.9v-15.7h47.2V72.9h15.7v47.2h47.2v15.7h-47.2V183.1z"/></g></g>
</svg>

After

Width:  |  Height:  |  Size: 844 B

Loading…
Cancel
Save