Refonte de la Page d'Accueil. Ajout de jeux dans le stub.
continuous-integration/drone/push Build is failing Details

pull/63/head
Rémi LAVERGNE 2 years ago
parent d10bfacd5e
commit 337434215a

@ -407,7 +407,7 @@
<Style TargetType="Image" x:Key="Stars">
<Style TargetType="Image" x:Key="BigStar">
<Setter Property="Source" Value="star.png"/>
<Setter Property="HorizontalOptions" Value="Start"/>
<Setter Property="VerticalOptions" Value="Start"/>
@ -425,6 +425,13 @@
<Setter Property="WidthRequest" Value="15"/>
</Style>
<Style TargetType="Image" x:Key="DownloadBlue">
<Setter Property="Source" Value="download_blue.png"/>
<Setter Property="HorizontalOptions" Value="Start"/>
<Setter Property="VerticalOptions" Value="Start"/>
<Setter Property="HeightRequest" Value="15"/>
</Style>
<Style TargetType="ImageButton" x:Key="ImageRecherche">
<Setter Property="HeightRequest" Value="97"/>
<Setter Property="WidthRequest" Value="170"/>

@ -21,12 +21,20 @@ namespace GameAtlas.Stub
ListUsers.Add(userTest);
ListAdmins.Add(admin);
Jeu TheLastOfUs = new Jeu("The Last Of Us Part I","5 Fevrier 2023","PS5 XOne PC","dev","ed", 5, 487,"Aventure", "cover_lastofus1.png");
Jeu ForzaHorizon = new Jeu("Forza Horizon 5", "12 Mars 2023", "Ps5", "dev", "ed", 4, 420, "Course", "cover_forzahorizon5.png");
Jeu Test = new Jeu("The Legend of Zelda: Tears of the Kingdom", "8 Janvier 2023", "Switch Pc", "dev", "ed", 5, 250, "Aventure", "cover_zelda.png");
Jeu TheLastOfUs = new Jeu("The Last Of Us Part I", "28 Mars 2023", "PS5 PC", "Naughty Dog LLC", "Naughty Dog LLC", 5, 487, "Solo Action Aventure", "cover_lastofus1.png");
Jeu ForzaHorizon = new Jeu("Forza Horizon 5", "9 Novembre 2021", "PC XOne", "Playground Games", "Xbox Game Studios", 4, 420, "Course Simulation Sport", "cover_forzahorizon5.png");
Jeu TOTK = new Jeu("The Legend of Zelda: Tears of the Kingdom", "12 Mai 2023", "Switch", "Nintendo", "Nintendo", 5, 250, "Action Aventure", "cover_zelda.png");
Jeu ReadyOrNot = new Jeu("Ready or Not", "18 décembre 2021", "PC", "VOID Interactive", "VOID Interactive", 5, 100, "Solo Action Aventure", "cover_readyornot.png");
Jeu Hogwarts = new Jeu("Hogwarts Legacy : L'Héritage de Poudlard", "10 février 2023", "PC Switch XOne", "Avalanche Software", "Warner Bros. Games", 5, 100, "Solo Action Aventure RPG", "cover_hogwarts.png");
Jeu RE4 = new Jeu("Resident Evil 4", "24 mars 2023", "PC XSeries", "CAPCOM Co., Ltd.", "CAPCOM Co., Ltd.", 5, 100, "Solo Action Aventure", "cover_residentevil4.png");
Jeu JediSurvivor = new Jeu("Star Wars Jedi: Survivor", "28 avril 2023", "PC XSeries", "Respawn", "Electronic Arts", 5, 100, "Solo Action Aventure", "cover_starwarsjedisurvivor.png");
ListJeu.Add(TheLastOfUs);
ListJeu.Add(ForzaHorizon);
ListJeu.Add(Test);
ListJeu.Add(TOTK);
ListJeu.Add(ReadyOrNot);
ListJeu.Add(Hogwarts);
ListJeu.Add(RE4);
ListJeu.Add(JediSurvivor);
return (ListJeu,ListAdmins,ListUsers);
}

@ -4,6 +4,6 @@
x:Class="GameAtlas.Views.Composants.BoutonVoir">
<Button Text="Voir" FontFamily="PTSansNarrow-Bold" FontSize="16" BackgroundColor="#FF4D00" HeightRequest="45" WidthRequest="93" Scale="0.85" CornerRadius="25" Clicked="OnVoirClicked" />
<Button Text="Voir" FontFamily="PTSansNarrow-Bold" FontSize="16" BackgroundColor="#FF4D00" HeightRequest="45" WidthRequest="93" Scale="0.85" CornerRadius="25" Clicked="OnVoirClicked" AnchorX="-1"/>
</ContentView>

@ -61,37 +61,45 @@
FontFamily="PTSansCaption-Bold"
FontSize="24"
Grid.Row="3"
Padding="25,20,0,0"
Padding="25,25,0,25"
/>
<ScrollView Orientation="Horizontal" Grid.Row="4" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" HorizontalScrollBarVisibility="Never">
<HorizontalStackLayout BindableLayout.ItemsSource="{Binding ListJeux}">
<ScrollView Orientation="Horizontal" Grid.Row="4" Padding="20,0,20,0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" HorizontalScrollBarVisibility="Never">
<HorizontalStackLayout BindableLayout.ItemsSource="{Binding ListJeuxAffiches}" Spacing="15">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Grid>
<ImageButton Source="{Binding Image}" CornerRadius="15" HeightRequest="160" WidthRequest="290" Clicked="OnButtonClicked"/>
<HorizontalStackLayout Margin="25,95,0,0" Spacing="5">
<Image Style="{StaticResource Stars}"/>
<Image Style="{StaticResource Stars}"/>
<Image Style="{StaticResource Stars}"/>
<Image Style="{StaticResource Stars}"/>
<Image Style="{StaticResource Stars}"/>
<Frame CornerRadius="10" HeightRequest="160" WidthRequest="290">
<ImageButton Source="{Binding Image}" HeightRequest="160" WidthRequest="290" Aspect="AspectFill" Clicked="OnButtonClicked"/>
</Frame>
<BoxView
Color="Black"
Opacity="0.3"
CornerRadius="10"
HeightRequest="65"
VerticalOptions="End"/>
<HorizontalStackLayout Margin="25,100,0,0" Spacing="5">
<Image Style="{StaticResource BigStar}"/>
<Image Style="{StaticResource BigStar}"/>
<Image Style="{StaticResource BigStar}"/>
<Image Style="{StaticResource BigStar}"/>
<Image Style="{StaticResource BigStar}"/>
</HorizontalStackLayout>
<Label Text="{Binding Nom}"
TextColor="White"
FontFamily="PTSansCaption-Bold"
FontSize="12"
Padding="25,110,0,0"/>
Padding="25,115,0,0"/>
<Image Source="download.png"
HorizontalOptions="Start"
HeightRequest="20"
WidthRequest="20"
Margin="23,120,0,0"/>
Margin="23,125,0,0"/>
<Label Text="{Binding NbTelechargement}"
TextColor="White"
FontFamily="PTSansCaption-Bold"
FontSize="8"
Padding="44,135,0,0"/>
Padding="46,138,0,0"/>
</Grid>
</DataTemplate>
</BindableLayout.ItemTemplate>
@ -107,14 +115,15 @@
/>
<Grid Grid.Row="6">
<VerticalStackLayout Spacing="40" BindableLayout.ItemsSource="{Binding ListJeux}">
<VerticalStackLayout Spacing="30" BindableLayout.ItemsSource="{Binding TopRatedGames}">
<BindableLayout.ItemTemplate>
<DataTemplate>
<HorizontalStackLayout Spacing="30">
<Image Source="{Binding Image}" HeightRequest="60" WidthRequest="100" Margin="25,0,0,0"/>
<VerticalStackLayout Spacing="15">
<Label Text="{Binding Nom}" FontFamily="PTSansNarrow-Bold" FontSize="15"/>
<Grid ColumnDefinitions="auto,*,auto">
<Frame Grid.Column="0" CornerRadius="5" HeightRequest="60" WidthRequest="100" Margin="25,0,0,0">
<Image Source="{Binding Image}" Aspect="AspectFill" />
</Frame>
<StackLayout Grid.Column="1" Spacing="25" Padding="20,0">
<Label Text="{Binding Nom}" FontFamily="PTSansNarrow-Bold" FontSize="13" LineBreakMode="TailTruncation" MaxLines="2"/>
<HorizontalStackLayout>
<Image Style="{StaticResource Star}"/>
<Label Text="{Binding Note}"
@ -122,28 +131,22 @@
FontFamily="PTSansNarrow-Bold"
FontSize="12"
Margin="6,0,15,0"/>
<Image Source="download_blue.png"
HeightRequest="20"
WidthRequest="20"
HorizontalOptions="Start"
VerticalOptions="Start"/>
<Image Style="{StaticResource DownloadBlue}"/>
<Label Text="{Binding NbTelechargement}"
TextColor="#7C7C7C"
FontFamily="PTSansNarrow-Bold"
FontSize="12"
Margin="6,0,0,0"/>
</HorizontalStackLayout>
</VerticalStackLayout>
<views:BoutonVoir/>
</HorizontalStackLayout>
</StackLayout>
<views:BoutonVoir Grid.Column="2"/>
</Grid>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
</Grid>
</Grid>
</ScrollView>

@ -1,18 +1,25 @@
using GameAtlas.Models;
using System.Collections.ObjectModel;
namespace GameAtlas.Views;
public partial class PageAcceuil : ContentPage
{
public ObservableCollection<Jeu> TopRatedGames { get; set; }
public ObservableCollection<Jeu> ListJeuxAffiches { get; set; }
public Manager AccueilManager => (App.Current as App).MyManager;
public PageAcceuil()
{
InitializeComponent();
BindingContext = AccueilManager;
TopRatedGames = new ObservableCollection<Jeu>(AccueilManager.ListJeux.OrderByDescending(jeu => jeu.Note).Take(3));
var cinqPremiersJeux = AccueilManager.ListJeux.Take(5);
ListJeuxAffiches = new ObservableCollection<Jeu>(cinqPremiersJeux);
BindingContext = this;
}
private async void OnProfil_Tapped(object sender, EventArgs e)

Loading…
Cancel
Save