💄 Coloration des logos et mises en place de la popup page afin d'add des livres

master
Lucas EVARD 2 years ago
parent ac35cbd296
commit 23c7e44322

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<toolkit:Popup xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="PocketBook.AddBook">
<VerticalStackLayout>
<Label Text="This is a very important message!" />
</VerticalStackLayout>
</toolkit:Popup>

@ -0,0 +1,11 @@
using CommunityToolkit.Maui.Views;
namespace PocketBook;
public partial class AddBook : Popup
{
public AddBook()
{
InitializeComponent();
}
}

@ -1,9 +1,14 @@
<?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"/>
x:Class="PocketBook.BookChange"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit">
<StackLayout Orientation="Horizontal" Margin="10,15,0,15">
<Image x:Name="imageName" WidthRequest="30" HeightRequest="30">
<Image.Behaviors>
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
</Image.Behaviors>
</Image>
<Label x:Name="propertyName" TextColor="{StaticResource Primary}" FontAttributes="Bold" VerticalOptions="Center" Margin="15,0,0,0"/>
</StackLayout>
</ContentView>

@ -1,4 +1,5 @@
using Microsoft.Extensions.Logging;
using CommunityToolkit.Maui;
namespace PocketBook;
@ -6,17 +7,18 @@ public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseMauiCommunityToolkit()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
#if DEBUG
builder.Logging.AddDebug();
builder.Logging.AddDebug();
#endif
return builder.Build();

@ -49,10 +49,14 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="5.3.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<MauiXaml Update="AddBook.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Auteur.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><g><path fill="#000000" d="M18.3,220.7H10V35.3h8.3V220.7z M26.6,220.6h-4.2V35.3h4.2V220.6z M39,220.6h-4.1V35.3H39V220.6z M59.7,220.6h-4.1V35.3h4.1V220.6z M80.3,220.6h-8.2V35.3h8.2V220.6z M96.9,220.6h-4.1V35.3h4.1V220.6z M105.2,220.6h-4.1V35.3h4.1V220.6z M113.5,220.6h-4.1V35.3h4.1V220.6z M134.2,220.6h-8.3V35.3h8.3V220.6z M154.9,220.6h-8.3V35.3h8.3V220.6z M171.5,220.6h-8.3V35.3h8.3V220.6z M188.1,220.6h-8.3V35.3h8.3V220.6z M200.4,220.6h-8.3V35.3h8.3V220.6z M225.3,220.6h-12.4V35.3h12.4V220.6z M233.6,220.6h-4.2V35.3h4.2V220.6z M246,220.7h-8.3V35.3h8.3V220.7z"/></g></g></g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

@ -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="M57.2,153.6v11.8c0,1.3-0.6,2-2,2H43.4c-1.3,0-2-0.7-2-2v-11.8c0-1.3,0.6-2,2-2h11.8C56.5,151.6,57.2,152.3,57.2,153.6z M72.9,122.1v11.8c0,1.3-0.6,2-2,2H43.4c-1.3,0-2-0.7-2-2v-11.8c0-1.3,0.6-2,2-2H71C72.3,120.1,72.9,120.8,72.9,122.1z M57.2,90.6v11.8c0,1.3-0.6,2-2,2H43.4c-1.3,0-2-0.7-2-2V90.6c0-1.3,0.6-2,2-2h11.8C56.5,88.7,57.2,89.3,57.2,90.6z M183.1,153.6v11.8c0,1.3-0.7,2-2,2H74.9c-1.3,0-2-0.7-2-2v-11.8c0-1.3,0.7-2,2-2h106.2C182.4,151.6,183.1,152.3,183.1,153.6z M104.4,122.1v11.8c0,1.3-0.7,2-2,2H90.6c-1.3,0-2-0.7-2-2v-11.8c0-1.3,0.7-2,2-2h11.8C103.7,120.1,104.4,120.8,104.4,122.1z M88.7,90.6v11.8c0,1.3-0.7,2-2,2H74.9c-1.3,0-2-0.7-2-2V90.6c0-1.3,0.7-2,2-2h11.8C88,88.7,88.7,89.3,88.7,90.6z M135.9,122.1v11.8c0,1.3-0.7,2-2,2h-11.8c-1.3,0-2-0.7-2-2v-11.8c0-1.3,0.6-2,2-2h11.8C135.2,120.1,135.9,120.8,135.9,122.1z M120.1,90.6v11.8c0,1.3-0.7,2-2,2h-11.8c-1.3,0-2-0.7-2-2V90.6c0-1.3,0.7-2,2-2h11.8C119.5,88.7,120.1,89.3,120.1,90.6z M167.3,122.1v11.8c0,1.3-0.6,2-2,2h-11.8c-1.3,0-2-0.7-2-2v-11.8c0-1.3,0.7-2,2-2h11.8C166.7,120.1,167.3,120.8,167.3,122.1z M214.5,153.6v11.8c0,1.3-0.7,2-2,2h-11.8c-1.3,0-2-0.7-2-2v-11.8c0-1.3,0.7-2,2-2h11.8C213.9,151.6,214.5,152.3,214.5,153.6z M151.6,90.6v11.8c0,1.3-0.7,2-2,2h-11.8c-1.3,0-2-0.7-2-2V90.6c0-1.3,0.7-2,2-2h11.8C150.9,88.7,151.6,89.3,151.6,90.6z M183.1,90.6v11.8c0,1.3-0.7,2-2,2h-11.8c-1.3,0-2-0.7-2-2V90.6c0-1.3,0.7-2,2-2h11.8C182.4,88.7,183.1,89.3,183.1,90.6z M214.5,90.6v43.3c0,1.3-0.7,2-2,2H185c-1.3,0-2-0.7-2-2v-11.8c0-1.3,0.7-2,2-2h13.8V90.6c0-1.3,0.6-2,2-2h11.8C213.9,88.7,214.5,89.3,214.5,90.6z M230.3,183.1V72.9H25.7v110.1L230.3,183.1L230.3,183.1z M246,72.9v110.1c0,4.3-1.5,8-4.6,11.1c-3.1,3.1-6.8,4.6-11.1,4.6H25.7c-4.3,0-8-1.5-11.1-4.6c-3.1-3.1-4.6-6.8-4.6-11.1V72.9c0-4.3,1.5-8,4.6-11.1c3.1-3.1,6.8-4.6,11.1-4.6h204.5c4.3,0,8,1.5,11.1,4.6C244.5,64.9,246,68.6,246,72.9z"/></g></g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -2,16 +2,25 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:PocketBook"
x:Class="PocketBook.TousPage">
x:Class="PocketBook.TousPage"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit">
<ScrollView>
<VerticalStackLayout>
<StackLayout Orientation="Horizontal" Padding="5,0">
<Image Source="chevron_left.svg"/>
<Image Source="chevron_left.svg">
<Image.Behaviors>
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
</Image.Behaviors>
</Image>
<Label VerticalTextAlignment="Center" Text="Mes livres" FontAttributes="Bold" HorizontalOptions="StartAndExpand" TextColor="{StaticResource Primary}" FontSize="15" Margin="5,0,0,0"/>
<Label Text="Tous" FontAttributes="Bold" FontSize="18" VerticalTextAlignment="Center" HorizontalOptions="CenterAndExpand" Margin="0,0,15,0"/>
<StackLayout HorizontalOptions="EndAndExpand" Orientation="Horizontal">
<Label VerticalTextAlignment="Center" Text="+" TextColor="{StaticResource Primary}" FontSize="30" />
<Image Margin="15,0,0,0" x:Name="imageArrows" WidthRequest="25" HeightRequest="25" Source="arrows.svg"/>
<ImageButton Margin="15,0,0,0" x:Name="imageArrows" Clicked="OnImageButtonClicked" WidthRequest="25" HeightRequest="25" Source="arrows.svg">
<ImageButton.Behaviors>
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
</ImageButton.Behaviors>
</ImageButton>
</StackLayout>
</StackLayout>
@ -20,7 +29,6 @@
<CollectionView.ItemTemplate>
<DataTemplate>
<StackLayout>
<StackLayout BackgroundColor="#F8F8F8" Padding="5">
<Label Text="{Binding name}" TextColor="#AFAFAF" FontAttributes="Bold" Margin="15,0,0,0" />
</StackLayout>
@ -47,6 +55,27 @@
</CollectionView.ItemTemplate>
</CollectionView>
<StackLayout Margin="150,300,25,0" BackgroundColor="#AFAFAF">
<StackLayout Orientation="Horizontal">
<Label Text="Ajouter un livre" Margin="15,0,0,0" HorizontalOptions="StartAndExpand" Padding="0,5,0,5"/>
<Image Source="barcode_scan" WidthRequest="20" HorizontalOptions="End" HeightRequest="20"/>
</StackLayout>
<Line BackgroundColor="Red"/>
<StackLayout Orientation="Horizontal">
<Label Text="Scanner un code-barres" HorizontalOptions="StartAndExpand" Margin="15,0,0,0"/>
<Image Source="barcode" WidthRequest="20" HorizontalOptions="End" HeightRequest="20"/>
</StackLayout>
<Line BackgroundColor="Red"/>
<StackLayout Orientation="Horizontal">
<Label Text="Scanner des codes-barres" HorizontalOptions="StartAndExpand" Margin="15,0,0,0"/>
<Image Source="magnifyingglass" WidthRequest="20" HorizontalOptions="End" HeightRequest="20"/>
</StackLayout>
<Line BackgroundColor="Red" StrokeThickness="5"/>
<Label Text="Rechercher en ligne" Margin="15,0,0,0"/>
<Line BackgroundColor="Red"/>
<Label Text="Saisir l'ISBN" Margin="15,0,0,0"/>
</StackLayout>
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -1,60 +1,68 @@
namespace PocketBook;
public partial class Book
{
public string name { get; set; }
public string type { get; set; }
public string auteur { get; set; }
public string image { get; set; }
public Book(string name, string type,string auteur)
{
this.name = name;
this.auteur = auteur;
this.type = type;
}
}
public partial class Auteur
{
public string name { get; set; }
public List<Book> books { get; set; }
public Auteur(string name)
{
this.name = name;
books = new List<Book>
{
new Book("Buveur d'encre", "En lecture", name),
new Book("Harry Potter et la pierre philosophale", "Non lu",name),
new Book("Le Seigneur des anneaux", "En lecture", name),
new Book("1984", "Terminé", name),
new Book("Le Petit Prince", "Non lu", name)
};
}
}
public partial class TousPage : ContentPage
{
public List<Auteur> mesAuteurs { get; set; }
public List<Book> books { get; set; }
public TousPage()
{
mesAuteurs = new List<Auteur>
{
new Auteur("J.K. Rowling"),
new Auteur("J.R.R. Tolkien")
};
InitializeComponent();
BindingContext=this;
}
public async void OnCollectionViewSelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.CurrentSelection.FirstOrDefault() is Book livreSelectionne)
{
await Navigation.PushAsync(new BookDetail(livreSelectionne));
}
}
using CommunityToolkit.Maui.Views;
namespace PocketBook;
public partial class Book
{
public string name { get; set; }
public string type { get; set; }
public string auteur { get; set; }
public string image { get; set; }
public Book(string name, string type,string auteur)
{
this.name = name;
this.auteur = auteur;
this.type = type;
}
}
public partial class Auteur
{
public string name { get; set; }
public List<Book> books { get; set; }
public Auteur(string name)
{
this.name = name;
books = new List<Book>
{
new Book("Buveur d'encre", "En lecture", name),
new Book("Harry Potter et la pierre philosophale", "Non lu",name),
new Book("Le Seigneur des anneaux", "En lecture", name),
new Book("1984", "Terminé", name),
new Book("Le Petit Prince", "Non lu", name)
};
}
}
public partial class TousPage : ContentPage
{
public List<Auteur> mesAuteurs { get; set; }
public List<Book> books { get; set; }
public bool clicked=false;
public TousPage()
{
mesAuteurs = new List<Auteur>
{
new Auteur("J.K. Rowling"),
new Auteur("J.R.R. Tolkien")
};
InitializeComponent();
BindingContext=this;
}
public async void OnCollectionViewSelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.CurrentSelection.FirstOrDefault() is Book livreSelectionne)
{
await Navigation.PushAsync(new BookDetail(livreSelectionne));
}
}
private void OnImageButtonClicked(object sender, EventArgs e)
{
var popup = new AddBook();
}
}
Loading…
Cancel
Save