diff --git a/MangaMap/CustomHeader.xaml b/MangaMap/CustomHeader.xaml index a6ad4de..d736f8f 100644 --- a/MangaMap/CustomHeader.xaml +++ b/MangaMap/CustomHeader.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MangaMap.NewContent1" Background="{StaticResource Primary}"> - + + - diff --git a/MangaMap/Resources/Images/test.jpg b/MangaMap/Resources/Images/evangelion.jpg similarity index 100% rename from MangaMap/Resources/Images/test.jpg rename to MangaMap/Resources/Images/evangelion.jpg diff --git a/MangaMap/Resources/Images/test2.png b/MangaMap/Resources/Images/oshinoko.png similarity index 100% rename from MangaMap/Resources/Images/test2.png rename to MangaMap/Resources/Images/oshinoko.png diff --git a/MangaMap/Resources/Images/star.png b/MangaMap/Resources/Images/star.png deleted file mode 100644 index 49ec51e..0000000 Binary files a/MangaMap/Resources/Images/star.png and /dev/null differ diff --git a/MangaMap/Resources/Images/star_empty.svg b/MangaMap/Resources/Images/star_empty.svg new file mode 100644 index 0000000..2ee298f --- /dev/null +++ b/MangaMap/Resources/Images/star_empty.svg @@ -0,0 +1,3 @@ + + + diff --git a/MangaMap/Resources/Images/star_full.svg b/MangaMap/Resources/Images/star_full.svg new file mode 100644 index 0000000..58bea28 --- /dev/null +++ b/MangaMap/Resources/Images/star_full.svg @@ -0,0 +1,3 @@ + + + diff --git a/MangaMap/Stub/Stub.cs b/MangaMap/Stub/Stub.cs index cebcf6e..7da9893 100644 --- a/MangaMap/Stub/Stub.cs +++ b/MangaMap/Stub/Stub.cs @@ -23,8 +23,8 @@ namespace MangaMap.Stub List genres = new List(); genres.Add("Action"); genres.Add("Future"); - Oeuvre o1 = new Oeuvre("test", genres, "TV", "C'est une bonne série", 4, 150, "test.jpg"); - Oeuvre o2 = new Oeuvre("test2", genres, "DVD", "A la fin il meurt", 2, 24, "test2.png"); + Oeuvre o1 = new Oeuvre("Evangelion", genres, "TV", "C'est une bonne série", 4, 150, "evangelion.jpg"); + Oeuvre o2 = new Oeuvre("[Oshi No Ko]", genres, "DVD", "A la fin il meurt", 2, 24, "oshinoko.png"); l1.Add(o1); l1.Add(o2); l2.Add(u1); l2.Add(u2); l2.Add(u3); diff --git a/MangaMap/Views/FicheAnime.xaml.cs b/MangaMap/Views/FicheAnime.xaml.cs index 11c6adc..98090ee 100644 --- a/MangaMap/Views/FicheAnime.xaml.cs +++ b/MangaMap/Views/FicheAnime.xaml.cs @@ -1,18 +1,48 @@ namespace MangaMap.Views; using Model; +using System.ComponentModel; +using System.Xml.Linq; -public partial class ficheAnime : ContentPage +public partial class ficheAnime : ContentPage, INotifyPropertyChanged { + + public Manager DataManager { get; set; } public Oeuvre AnimeModel { get; set; } public ficheAnime() { + + InitializeComponent(); - // Exemple de création d'une instance de la classe Oeuvre - List genres = new List() { "Action", "Aventure" }; - AnimeModel = new Oeuvre("Nom de l'oeuvre", genres, "Type de l'oeuvre", "Description de l'oeuvre", 5, 12, "Chemin/vers/l'affiche.png"); + this.BindingContext = this; + } + + public ficheAnime(Oeuvre anime) + { + AnimeModel = anime; + + InitializeComponent(); this.BindingContext = this; } + + private void SetNote(float note) + { + note = (int)note; // Tronquer à un entier car nous ne gérons actuellement pas les demi-étoiles + var starImages = star.Children.OfType().Reverse().ToList(); + foreach (var img in starImages) + { + if (note > 0) + { + img.Opacity = 1; + note--; + } + else + { + img.Opacity = 0; + } + } + } + } \ No newline at end of file diff --git a/MangaMap/Views/ficheAnime.xaml b/MangaMap/Views/ficheAnime.xaml index 7b60d09..a7e4538 100644 --- a/MangaMap/Views/ficheAnime.xaml +++ b/MangaMap/Views/ficheAnime.xaml @@ -12,14 +12,15 @@ - - - @@ -28,25 +29,26 @@ - - - - - - - -