mise à jour du déplacement des utilisateurs dans l'interface + liste avec avancement de l'utilisateur

pull/46/head
Vianney JOURDY 2 years ago
parent 0f336bf108
commit b7d23ecaff

@ -21,7 +21,7 @@
IsVisible="{Binding IsUserLoggedIn}" />
<ImageButton Grid.Column="3"
Source="account_circle.png"
Source = "account_circle.png"
MaximumHeightRequest="30"
MaximumWidthRequest="30"
BackgroundColor="{StaticResource Primary}"

@ -2,6 +2,11 @@ using MangaMap.Views;
namespace MangaMap;
using Models;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Input;
using System.Xml.Linq;
using Microsoft.Maui.Graphics;
using INotifyPropertyChanged = System.ComponentModel.INotifyPropertyChanged;
/// <summary>
@ -35,7 +40,7 @@ public partial class NewContent1 : ContentView, INotifyPropertyChanged
/// <param name="sender">L'objet déclencheur de l'événement.</param>
/// <param name="e">Les arguments de l'événement.</param>
async void SettingButton_Clicked(object sender, System.EventArgs e)
{
{
await Shell.Current.GoToAsync("//page/secondaire/settingsPage");
}
@ -46,6 +51,10 @@ public partial class NewContent1 : ContentView, INotifyPropertyChanged
/// <param name="e">Les arguments de l'événement.</param>
async void AccountButton_Clicked(object sender, System.EventArgs e)
{
if (my_manager.UtilisateurActuel.Email != null)
{
return;
}
await Shell.Current.GoToAsync("//page/secondaire/connexionPage");
}
@ -56,6 +65,11 @@ public partial class NewContent1 : ContentView, INotifyPropertyChanged
/// <param name="e">Les arguments de l'événement.</param>
async void ListButton_Clicked(object sender, System.EventArgs e)
{
if (my_manager.UtilisateurActuel.Email == null)
{
return;
}
await Navigation.PushAsync(new listPage());
//await Shell.Current.GoToAsync("//page/secondaire/listPage");
}
}

@ -11,6 +11,16 @@
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<!--<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
--><!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET --><!--
--><!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> --><!--
<OutputType>Exe</OutputType>
<RootNamespace>MangaMap</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>-->
<!-- Display name -->
<ApplicationTitle>MangaMap</ApplicationTitle>
@ -135,6 +145,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DataContractPersistance\DataContractPersistance.csproj" />
<ProjectReference Include="..\Models\Models.csproj" />
<ProjectReference Include="..\Stub\Stub.csproj" />
</ItemGroup>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -31,11 +31,12 @@
<VerticalStackLayout BindableLayout.ItemsSource="{Binding my_manager.UtilisateurActuel.ListeOeuvreEnVisionnage}" Spacing="10">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Grid Margin="20,0,20,20" ColumnDefinitions="*,*,300,300">
<Grid x:Name="grille" Margin="20,0,20,20" ColumnDefinitions="*,*,300,200,100">
<ImageButton Grid.Column="0" Source="{Binding Affiche}" Style="{StaticResource ImageAnime}" HorizontalOptions="Start" Clicked="AnimeImageClickedList"/>
<Label Grid.Column="1" Text="{Binding Nom}" TextColor="White" FontSize="Medium" VerticalOptions="Center" Margin="15"/>
<Label Grid.Column="2" Text="{Binding Note, StringFormat='{0}/5'}" TextColor="White" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="Center"/>
<Label Grid.Column="3" Text="{Binding NbEpisodes}" TextColor="White" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="End"/>
<Label Grid.Column="3" Text="{Binding NombresEpVu}" TextColor="White" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="End"/>
<Label Grid.Column="4" Text="{Binding NbEpisodes, StringFormat='/{0}'}" TextColor="White" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="End"/>
</Grid>
</DataTemplate>
@ -70,11 +71,12 @@
<VerticalStackLayout BindableLayout.ItemsSource="{Binding my_manager.UtilisateurActuel.ListeOeuvreDejaVu}" Spacing="10">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Grid Margin="20,0,20,20" ColumnDefinitions="*,*,300,300">
<Grid x:Name="grille" Margin="20,0,20,20" ColumnDefinitions="*,*,300,200,100">
<ImageButton Grid.Column="0" Source="{Binding Affiche}" Style="{StaticResource ImageAnime}" HorizontalOptions="Start" Clicked="AnimeImageClickedList"/>
<Label Grid.Column="1" Text="{Binding Nom}" TextColor="White" FontSize="Medium" VerticalOptions="Center" Margin="15"/>
<Label Grid.Column="2" Text="{Binding Note, StringFormat='{0}/5'}" TextColor="White" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="Center"/>
<Label Grid.Column="3" Text="{Binding NbEpisodes}" TextColor="White" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="End"/>
<Label Grid.Column="3" Text="{Binding NombresEpVu}" TextColor="White" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="End"/>
<Label Grid.Column="4" Text="{Binding NbEpisodes, StringFormat='/{0}'}" TextColor="White" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="End"/>
</Grid>
</DataTemplate>
</BindableLayout.ItemTemplate>
@ -109,11 +111,12 @@
<VerticalStackLayout BindableLayout.ItemsSource="{Binding my_manager.UtilisateurActuel.ListeOeuvrePourPlusTard}" Spacing="10">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Grid Margin="20,0,20,20" ColumnDefinitions="*,*,300,300">
<Grid x:Name="grille" Margin="20,0,20,20" ColumnDefinitions="*,*,300,200,100">
<ImageButton Grid.Column="0" Source="{Binding Affiche}" Style="{StaticResource ImageAnime}" HorizontalOptions="Start" Clicked="AnimeImageClickedList"/>
<Label Grid.Column="1" Text="{Binding Nom}" TextColor="White" FontSize="Medium" VerticalOptions="Center" Margin="15"/>
<Label Grid.Column="2" Text="{Binding Note, StringFormat='{0}/5'}" TextColor="White" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="Center"/>
<Label Grid.Column="3" Text="{Binding NbEpisodes}" TextColor="White" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="End"/>
<Label Grid.Column="3" Text="{Binding NombresEpVu}" TextColor="White" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="End"/>
<Label Grid.Column="4" Text="{Binding NbEpisodes, StringFormat='/{0}'}" TextColor="White" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="End"/>
</Grid>
</DataTemplate>
</BindableLayout.ItemTemplate>
@ -148,11 +151,12 @@
<VerticalStackLayout BindableLayout.ItemsSource="{Binding my_manager.UtilisateurActuel.ListeOeuvreFavorites}" Spacing="10">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Grid Margin="20,0,20,20" ColumnDefinitions="*,*,300,300">
<Grid x:Name="grille" Margin="20,0,20,20" ColumnDefinitions="*,*,300,200,100">
<ImageButton Grid.Column="0" Source="{Binding Affiche}" Style="{StaticResource ImageAnime}" HorizontalOptions="Start" Clicked="AnimeImageClickedList"/>
<Label Grid.Column="1" Text="{Binding Nom}" TextColor="White" FontSize="Medium" VerticalOptions="Center" Margin="15"/>
<Label Grid.Column="2" Text="{Binding Note, StringFormat='{0}/5'}" TextColor="White" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="Center"/>
<Label Grid.Column="3" Text="{Binding NbEpisodes}" TextColor="White" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="End"/>
<Label Grid.Column="3" Text="{Binding NombresEpVu}" TextColor="White" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="End"/>
<Label Grid.Column="4" Text="{Binding NbEpisodes, StringFormat='/{0}'}" TextColor="White" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="End"/>
</Grid>
</DataTemplate>
</BindableLayout.ItemTemplate>

@ -1,5 +1,6 @@
namespace MangaMap.Views.Composants;
using Models;
using System.Diagnostics;
using System.Xml;
public partial class ListOeuvre : ContentView

@ -279,7 +279,6 @@ namespace MangaMap.Views
my_manager.UtilisateurActuel.notesNombres.Remove(AnimeModel.Nom, out x);
x[1] = nb;
my_manager.UtilisateurActuel.notesNombres.Add(AnimeModel.Nom, x);
return;
}
else
{
@ -288,6 +287,7 @@ namespace MangaMap.Views
my_manager.UtilisateurActuel.notesNombres.Add(AnimeModel.Nom, x);
}
AnimeModel.NombresEpVu = nb;
my_manager.sauvegarder();
}
}

@ -52,13 +52,11 @@ namespace MangaMap.Views
int imagesParLigne = 4;
int indice = 0;
for (int i = 0; i < my_manager.Oeuvres.Count; i++)
foreach (Oeuvre o in my_manager.Oeuvres)
{
Oeuvre favoris = my_manager.Oeuvres[i];
ImageButton imageButton = new ImageButton
{
Source = favoris.Affiche,
Source = o.Affiche,
WidthRequest = 170,
MaximumHeightRequest = 190,
MinimumHeightRequest = 190,

@ -3,6 +3,7 @@ using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Stub;
using Models;
using System.Diagnostics;
/// <summary>
/// Classe représentant la page de connexion de l'application.
@ -68,6 +69,15 @@ public partial class loginPage : ContentPage
// On garde l'utilisateur qui vient de se connecter pour accéder à ses informations
my_manager.UtilisateurActuel = utilisateur;
List<int> x;
foreach (Oeuvre o in my_manager.Oeuvres)
{
if (my_manager.UtilisateurActuel.notesNombres.TryGetValue(o.Nom, out x))
o.NombresEpVu = x[1];
else
o.NombresEpVu = 0;
}
// Rediriger l'utilisateur vers la page principale
await Shell.Current.GoToAsync("//page/homePage");
}

@ -28,6 +28,12 @@ public partial class settingsPage : ContentPage
{
my_manager.UtilisateurActuel = new Utilisateur();
my_manager.isAdmin = false;
foreach (Oeuvre o in my_manager.Oeuvres)
{
o.NombresEpVu = 999;
}
await Shell.Current.GoToAsync("//page/secondaire/connexionPage");
}

@ -74,6 +74,9 @@ namespace Models
[DataMember]
public string Affiche { get; private set; }
[DataMember]
public int NombresEpVu { get; set; }
/// <summary>
/// Initialise une nouvelle instance de la classe Oeuvre avec les informations spécifiées.
/// </summary>

Loading…
Cancel
Save