Merge pull request 'pageProfils' (#94) from pageProfils into dev
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Reviewed-on: #94 Reviewed-by: Rémi LAVERGNE <remi.lavergne@etu.uca.fr>pull/99/head
commit
feb662dd39
@ -1,43 +1,43 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
xmlns:views="clr-namespace:Trek_12.Views.Components"
|
xmlns:views="clr-namespace:Trek_12.Views.Components"
|
||||||
x:Class="Trek_12.Views.PageLeaderBoard"
|
x:Class="Trek_12.Views.PageLeaderBoard"
|
||||||
Title="PageLeaderBoard">
|
Title="PageLeaderBoard">
|
||||||
<Grid BackgroundColor="BlanchedAlmond"
|
<Grid BackgroundColor="BlanchedAlmond"
|
||||||
RowDefinitions="auto,6*,*">
|
RowDefinitions="auto,6*,*">
|
||||||
<VerticalStackLayout>
|
<VerticalStackLayout>
|
||||||
<Label
|
<Label
|
||||||
Text="Leader board"
|
Text="Leader board"
|
||||||
VerticalOptions="Center"
|
VerticalOptions="Center"
|
||||||
HorizontalOptions="Center"
|
HorizontalOptions="Center"
|
||||||
FontSize="Title"/>
|
FontSize="Title"/>
|
||||||
<BoxView
|
<BoxView
|
||||||
Color="DarkSalmon"
|
Color="DarkSalmon"
|
||||||
HeightRequest="1"
|
HeightRequest="1"
|
||||||
WidthRequest="125"/>
|
WidthRequest="125"/>
|
||||||
</VerticalStackLayout>
|
</VerticalStackLayout>
|
||||||
<ScrollView Grid.Row="1"
|
<ScrollView Grid.Row="1"
|
||||||
VerticalOptions="FillAndExpand"
|
VerticalOptions="FillAndExpand"
|
||||||
VerticalScrollBarVisibility="Never"
|
VerticalScrollBarVisibility="Never"
|
||||||
Margin="0,10">
|
Margin="0,10">
|
||||||
<VerticalStackLayout>
|
<VerticalStackLayout>
|
||||||
<views:ContentLeaderBoard/>
|
<views:ContentLeaderBoard/>
|
||||||
<views:ContentLeaderBoard/>
|
<views:ContentLeaderBoard/>
|
||||||
<views:ContentLeaderBoard/>
|
<views:ContentLeaderBoard/>
|
||||||
<views:ContentLeaderBoard/>
|
<views:ContentLeaderBoard/>
|
||||||
<views:ContentLeaderBoard/>
|
<views:ContentLeaderBoard/>
|
||||||
<views:ContentLeaderBoard/>
|
<views:ContentLeaderBoard/>
|
||||||
</VerticalStackLayout>
|
</VerticalStackLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
<Button Text="Back"
|
<Button Text="Back"
|
||||||
BackgroundColor="OliveDrab"
|
BackgroundColor="OliveDrab"
|
||||||
FontSize="Title"
|
FontSize="Title"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
HorizontalOptions="Start"
|
HorizontalOptions="Start"
|
||||||
CornerRadius="20"
|
CornerRadius="20"
|
||||||
WidthRequest="150"
|
WidthRequest="150"
|
||||||
HeightRequest="75"
|
HeightRequest="75"
|
||||||
Margin="10"/>
|
Margin="10"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</ContentPage>
|
</ContentPage>
|
@ -1,9 +1,9 @@
|
|||||||
namespace Trek_12.Views;
|
namespace Trek_12.Views;
|
||||||
|
|
||||||
public partial class PageLeaderBoard : ContentPage
|
public partial class PageLeaderBoard : ContentPage
|
||||||
{
|
{
|
||||||
public PageLeaderBoard()
|
public PageLeaderBoard()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,9 +1,66 @@
|
|||||||
namespace Trek_12.Views;
|
namespace Trek_12.Views;
|
||||||
|
using Stub;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using CommunityToolkit.Maui.Alerts;
|
||||||
|
using CommunityToolkit.Maui.Core;
|
||||||
|
|
||||||
public partial class PageProfils : ContentPage
|
public partial class PageProfils : ContentPage
|
||||||
{
|
{
|
||||||
public PageProfils()
|
public Stub MyStub { get; set; } = new Stub();
|
||||||
|
|
||||||
|
public PageProfils()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
BindingContext = MyStub;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
async void Button_ClickedAdd(System.Object sender, System.EventArgs e)
|
||||||
|
{
|
||||||
|
string result = await DisplayPromptAsync("Info", $"Choose a name : ", "Ok");
|
||||||
|
Debug.WriteLine("Answer: " + result);
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
Debug.WriteLine("bam, added");
|
||||||
|
MyStub.Add(result, "profile.jpg");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async void Button_ClickedPop(System.Object sender, System.EventArgs e)
|
||||||
|
{
|
||||||
|
string result = await DisplayPromptAsync("Info", $"Choose a name to delete : ", "Ok");
|
||||||
|
Debug.WriteLine("Answer: " + result);
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
Debug.WriteLine("bam, deleted");
|
||||||
|
MyStub.Pop(result, "profile.jpg");
|
||||||
|
}
|
||||||
|
else Debug.WriteLine("Pseudo not found");
|
||||||
|
}
|
||||||
|
|
||||||
|
async void Button_ClickedModify(System.Object sender, System.EventArgs e)
|
||||||
|
{
|
||||||
|
string result = await DisplayPromptAsync("Info", $"Choose a name to modify : ", "Ok");
|
||||||
|
Debug.WriteLine("Answer: " + result);
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
string tomodify = await DisplayPromptAsync("Info", $"How will you rename it ?: ", "Ok");
|
||||||
|
Debug.WriteLine("Answer: " + tomodify);
|
||||||
|
if (tomodify != null)
|
||||||
|
{
|
||||||
|
Debug.WriteLine("bam, modified");
|
||||||
|
bool ismodified = MyStub.Modify(result, tomodify);
|
||||||
|
|
||||||
|
if (ismodified)
|
||||||
|
{
|
||||||
|
Debug.WriteLine("Modified");
|
||||||
|
}
|
||||||
|
else Debug.WriteLine("Player not found");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else Debug.WriteLine("Did not found");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in new issue