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" ?>
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:views="clr-namespace:Trek_12.Views.Components"
|
||||
x:Class="Trek_12.Views.PageLeaderBoard"
|
||||
Title="PageLeaderBoard">
|
||||
<Grid BackgroundColor="BlanchedAlmond"
|
||||
RowDefinitions="auto,6*,*">
|
||||
<VerticalStackLayout>
|
||||
<Label
|
||||
Text="Leader board"
|
||||
VerticalOptions="Center"
|
||||
HorizontalOptions="Center"
|
||||
FontSize="Title"/>
|
||||
<BoxView
|
||||
Color="DarkSalmon"
|
||||
HeightRequest="1"
|
||||
WidthRequest="125"/>
|
||||
</VerticalStackLayout>
|
||||
<ScrollView Grid.Row="1"
|
||||
VerticalOptions="FillAndExpand"
|
||||
VerticalScrollBarVisibility="Never"
|
||||
Margin="0,10">
|
||||
<VerticalStackLayout>
|
||||
<views:ContentLeaderBoard/>
|
||||
<views:ContentLeaderBoard/>
|
||||
<views:ContentLeaderBoard/>
|
||||
<views:ContentLeaderBoard/>
|
||||
<views:ContentLeaderBoard/>
|
||||
<views:ContentLeaderBoard/>
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
<Button Text="Back"
|
||||
BackgroundColor="OliveDrab"
|
||||
FontSize="Title"
|
||||
Grid.Row="2"
|
||||
HorizontalOptions="Start"
|
||||
CornerRadius="20"
|
||||
WidthRequest="150"
|
||||
HeightRequest="75"
|
||||
Margin="10"/>
|
||||
</Grid>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:views="clr-namespace:Trek_12.Views.Components"
|
||||
x:Class="Trek_12.Views.PageLeaderBoard"
|
||||
Title="PageLeaderBoard">
|
||||
<Grid BackgroundColor="BlanchedAlmond"
|
||||
RowDefinitions="auto,6*,*">
|
||||
<VerticalStackLayout>
|
||||
<Label
|
||||
Text="Leader board"
|
||||
VerticalOptions="Center"
|
||||
HorizontalOptions="Center"
|
||||
FontSize="Title"/>
|
||||
<BoxView
|
||||
Color="DarkSalmon"
|
||||
HeightRequest="1"
|
||||
WidthRequest="125"/>
|
||||
</VerticalStackLayout>
|
||||
<ScrollView Grid.Row="1"
|
||||
VerticalOptions="FillAndExpand"
|
||||
VerticalScrollBarVisibility="Never"
|
||||
Margin="0,10">
|
||||
<VerticalStackLayout>
|
||||
<views:ContentLeaderBoard/>
|
||||
<views:ContentLeaderBoard/>
|
||||
<views:ContentLeaderBoard/>
|
||||
<views:ContentLeaderBoard/>
|
||||
<views:ContentLeaderBoard/>
|
||||
<views:ContentLeaderBoard/>
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
<Button Text="Back"
|
||||
BackgroundColor="OliveDrab"
|
||||
FontSize="Title"
|
||||
Grid.Row="2"
|
||||
HorizontalOptions="Start"
|
||||
CornerRadius="20"
|
||||
WidthRequest="150"
|
||||
HeightRequest="75"
|
||||
Margin="10"/>
|
||||
</Grid>
|
||||
</ContentPage>
|
@ -1,9 +1,9 @@
|
||||
namespace Trek_12.Views;
|
||||
|
||||
public partial class PageLeaderBoard : ContentPage
|
||||
{
|
||||
public PageLeaderBoard()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
namespace Trek_12.Views;
|
||||
|
||||
public partial class PageLeaderBoard : ContentPage
|
||||
{
|
||||
public PageLeaderBoard()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -1,9 +1,66 @@
|
||||
namespace Trek_12.Views;
|
||||
using Stub;
|
||||
using System.Diagnostics;
|
||||
using CommunityToolkit.Maui.Alerts;
|
||||
using CommunityToolkit.Maui.Core;
|
||||
|
||||
public partial class PageProfils : ContentPage
|
||||
{
|
||||
public PageProfils()
|
||||
public Stub MyStub { get; set; } = new Stub();
|
||||
|
||||
public PageProfils()
|
||||
{
|
||||
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