add recipe view page

pull/26/head
maxime.BATISTA@etu.uca.fr 2 years ago
parent 6b24c7657f
commit c669811f0d

@ -23,5 +23,10 @@
Title="Search Page"
ContentTemplate="{DataTemplate views:SearchPage}"
Route="Search" />
<ShellContent
Title="Recipe Page"
ContentTemplate="{DataTemplate views:RecipePage}"
Route="Recipe" />
</TabBar>
</Shell>

@ -1,48 +0,0 @@
<?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"
x:Class="ShoopNCook.MainPage">
<ScrollView>
<VerticalStackLayout
Spacing="25"
Padding="30,0"
VerticalOptions="Center">
<Image
Source="dotnet_bot.png"
SemanticProperties.Description="Cute dot net bot waving hi to you!"
HeightRequest="200"
HorizontalOptions="Center" />
<Label
Text="Hello, World!"
SemanticProperties.HeadingLevel="Level1"
FontSize="32"
HorizontalOptions="Center" />
<Label
Text="Welcome to .NET Multi-platform App UI"
SemanticProperties.HeadingLevel="Level2"
SemanticProperties.Description="Welcome to dot net Multi platform App U I"
FontSize="18"
HorizontalOptions="Center" />
<Button
x:Name="CounterBtn"
Text="Click me !"
SemanticProperties.Hint="Counts the number of times you click"
Clicked="OnCounterClicked"
HorizontalOptions="Center" />
<Button
x:Name="RedirectBtn"
Text="Goto page 2"
SemanticProperties.Hint="Goto page 2"
Clicked="OnCounterClicked"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -1,29 +0,0 @@
namespace ShoopNCook;
public partial class MainPage : ContentPage
{
int count = 0;
public MainPage()
{
InitializeComponent();
}
private void OnCounterClicked(object sender, EventArgs e)
{
count++;
if (count == 1)
CounterBtn.Text = $"Clicked {count} time";
else
CounterBtn.Text = $"Clicked {count} times !!!";
SemanticScreenReader.Announce(CounterBtn.Text);
}
private void OnRedirectionClicked(object sender, EventArgs e)
{
//komen onfé
}
}

@ -13,7 +13,8 @@ public static class MauiProgram
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
fonts.AddFont("Poppins-bold.ttf", "PoppinsBold");
fonts.AddFont("Poppins-Bold.ttf", "PoppinsBold");
fonts.AddFont("Poppins-Medium.ttf", "PoppinsMedium");
});
#if DEBUG

@ -0,0 +1,3 @@
<svg width="34" height="31" viewBox="0 0 34 31" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18.8484 28.1694C18.0823 28.659 17.4449 29.0352 17.0002 29.2883C16.5554 29.0351 15.9179 28.6587 15.1518 28.1689C13.6037 27.179 11.5458 25.7356 9.4949 23.9185C5.32576 20.2247 1.50035 15.2682 1.50035 9.65054H1.5004L1.50029 9.63777C1.48259 7.55869 2.26883 5.55225 3.69638 4.03595C5.1148 2.52935 7.05796 1.62189 9.1264 1.5001C10.4583 1.50706 11.7649 1.86407 12.9144 2.53526C14.0756 3.21319 15.0344 4.1871 15.693 5.35661L17 7.67793L18.3071 5.35661C18.9654 4.18738 19.924 3.21365 21.0848 2.53573C22.234 1.86456 23.5402 1.5074 24.8717 1.50011C26.9405 1.62143 28.8841 2.52869 30.3029 4.03534C31.7309 5.55169 32.5174 7.5584 32.4997 9.63779L32.4997 9.63779V9.65054C32.4997 15.2705 28.6741 20.227 24.5052 23.9201C22.4543 25.7369 20.3964 27.1799 18.8484 28.1694Z" stroke="#FF8988" stroke-width="3"/>
</svg>

After

Width:  |  Height:  |  Size: 900 B

@ -0,0 +1,3 @@
<svg width="34" height="31" viewBox="0 0 34 31" fill="#FF8988" xmlns="http://www.w3.org/2000/svg">
<path d="M17.4833 30.164C17.282 30.2785 17.1191 30.3685 17.0001 30.4332C16.881 30.3684 16.7181 30.2784 16.5168 30.1639C16.0585 29.9031 15.4019 29.5157 14.6132 29.0114C13.0346 28.0021 10.932 26.5278 8.83175 24.667C4.60876 20.9254 0.500347 15.715 0.500365 9.65054L0.500329 9.64628C0.480433 7.30919 1.36427 5.05421 2.96829 3.35047C4.56927 1.64996 6.76472 0.629282 9.09953 0.500009C10.6178 0.50227 12.1082 0.906582 13.4186 1.67168C14.7329 2.43903 15.8186 3.54158 16.5643 4.86597L17 5.63975L17.4357 4.86597C18.1812 3.5419 19.2666 2.43954 20.5804 1.67221C21.8904 0.907138 23.3805 0.502649 24.8983 0.500013C27.2335 0.628758 29.4295 1.64921 31.0309 3.34977C32.6354 5.05357 33.5195 7.30884 33.4997 9.64629V9.65054C33.4997 15.7173 29.3912 20.9277 25.1683 24.6686C23.068 26.5292 20.9654 28.003 19.3869 29.012C18.5982 29.5161 17.9416 29.9034 17.4833 30.164Z" stroke="#FF8988"/>
</svg>

After

Width:  |  Height:  |  Size: 972 B

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="#FFFFFF" height="48" viewBox="0 96 960 960" width="48"><path d="M230 606q-12.75 0-21.375-8.675-8.625-8.676-8.625-21.5 0-12.825 8.625-21.325T230 546h500q12.75 0 21.375 8.675 8.625 8.676 8.625 21.5 0 12.825-8.625 21.325T730 606H230Z"/></svg>

After

Width:  |  Height:  |  Size: 285 B

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 96 960 960" width="48"><path d="M220.63 997.043q-32.19 0-54.747-22.556-22.557-22.557-22.557-54.748v-432.5q0-32.624 22.557-55.084 22.557-22.459 54.747-22.459h56.805v-90.739q0-85.228 59.245-144.636 59.246-59.408 143.234-59.408 83.989 0 143.32 59.408 59.331 59.408 59.331 144.636v90.739h56.805q32.289 0 54.916 22.459 22.627 22.46 22.627 55.084v432.5q0 32.191-22.627 54.748-22.627 22.556-54.916 22.556H220.63Zm0-77.304h518.74v-432.5H220.63v432.5Zm259.618-133.522q34.035 0 57.817-23.514 23.783-23.514 23.783-56.534 0-32.082-24.031-57.984-24.03-25.902-58.065-25.902t-57.817 25.947q-23.783 25.947-23.783 58.48 0 32.631 24.031 56.069 24.03 23.438 58.065 23.438ZM354.739 409.696h250.522v-90.684q0-53.389-36.478-89.972-36.478-36.583-88.727-36.583-52.248 0-88.782 36.583-36.535 36.583-36.535 89.972v90.684ZM220.63 919.739v-432.5 432.5Z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" fill="#FFFFFF" height="48" viewBox="0 96 960 960" width="48"><path d="M220.63 997.043q-32.19 0-54.747-22.556-22.557-22.557-22.557-54.748v-432.5q0-32.624 22.557-55.084 22.557-22.459 54.747-22.459h56.805v-90.739q0-85.228 59.245-144.636 59.246-59.408 143.234-59.408 83.989 0 143.32 59.408 59.331 59.408 59.331 144.636v90.739h56.805q32.289 0 54.916 22.459 22.627 22.46 22.627 55.084v432.5q0 32.191-22.627 54.748-22.627 22.556-54.916 22.556H220.63Zm0-77.304h518.74v-432.5H220.63v432.5Zm259.618-133.522q34.035 0 57.817-23.514 23.783-23.514 23.783-56.534 0-32.082-24.031-57.984-24.03-25.902-58.065-25.902t-57.817 25.947q-23.783 25.947-23.783 58.48 0 32.631 24.031 56.069 24.03 23.438 58.065 23.438ZM354.739 409.696h250.522v-90.684q0-53.389-36.478-89.972-36.478-36.583-88.727-36.583-52.248 0-88.782 36.583-36.535 36.583-36.535 89.972v90.684ZM220.63 919.739v-432.5 432.5Z"/></svg>

Before

Width:  |  Height:  |  Size: 896 B

After

Width:  |  Height:  |  Size: 911 B

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="#FFFFFF" height="48" viewBox="0 96 960 960" width="48"><path d="M479.825 856Q467 856 458.5 847.375T450 826V606H230q-12.75 0-21.375-8.675-8.625-8.676-8.625-21.5 0-12.825 8.625-21.325T230 546h220V326q0-12.75 8.675-21.375 8.676-8.625 21.5-8.625 12.825 0 21.325 8.625T510 326v220h220q12.75 0 21.375 8.675 8.625 8.676 8.625 21.5 0 12.825-8.625 21.325T730 606H510v220q0 12.75-8.675 21.375-8.676 8.625-21.5 8.625Z"/></svg>

After

Width:  |  Height:  |  Size: 461 B

@ -6,7 +6,7 @@
<Style TargetType="Border"
x:Key="SecondaryBorder">
<Setter Property="StrokeShape" Value="RoundRectangle 12"/>
<Setter Property="StrokeShape" Value="RoundRectangle 20"/>
<Setter Property="Stroke" Value="{StaticResource BackgroundSecondary}"/>
<Setter Property="BackgroundColor" Value="{StaticResource BackgroundSecondary}"/>
</Style>
@ -15,7 +15,7 @@
x:Key="UserInput">
<Setter Property="TextColor" Value="{StaticResource TextColorPrimary}"/>
<Setter Property="PlaceholderColor" Value="{StaticResource TextColorSecondary}"/>
<Setter Property="FontFamily" Value="PoppinsBold"/>
<Setter Property="FontFamily" Value="PoppinsMedium"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="Margin" Value="7, 0, 0, 0"/>
</Style>
@ -23,10 +23,36 @@
<Style
TargetType="Button"
x:Key="UserButton">
<Setter Property="FontFamily" Value="PoppinsBold"/>
<Setter Property="FontFamily" Value="PoppinsMedium"/>
<Setter Property="FontSize" Value="20"/>
</Style>
<Style
TargetType="Label"
x:Key="h1">
<Setter Property="FontFamily" Value="PoppinsMedium"/>
<Setter Property="FontSize" Value="24"/>
<Setter Property="TextColor" Value="{StaticResource TextColorPrimary}"/>
<Setter Property="FontAttributes" Value="Bold"/>
</Style>
<Style
TargetType="Label"
x:Key="h2">
<Setter Property="FontFamily" Value="PoppinsMedium"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="TextColor" Value="{StaticResource TextColorPrimary}"/>
<Setter Property="FontAttributes" Value="Bold"/>
</Style>
<Style
TargetType="Label"
x:Key="Small">
<Setter Property="FontFamily" Value="PoppinsMedium"/>
<Setter Property="FontSize" Value="17"/>
<Setter Property="TextColor" Value="{StaticResource TextColorSecondary}"/>
</Style>
<Style TargetType="ActivityIndicator">
<Setter Property="Color" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" />
</Style>

@ -0,0 +1,87 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<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>ShoopNCook</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<!-- Display name -->
<ApplicationTitle>ShoopNCook</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>com.companyname.shoopncook</ApplicationId>
<ApplicationIdGuid>bf17e1fe-a722-42f6-a24d-3327d351c924</ApplicationIdGuid>
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>
<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup>
<None Remove="Resources\Fonts\Poppins-Bold.ttf" />
<None Remove="Resources\Images\email_icon.svg" />
<None Remove="Resources\Images\facebook_logo.svg" />
<None Remove="Resources\Images\password_icon.svg" />
<None Remove="Resources\Images\search_options.svg" />
<None Remove="Resources\Images\visibility_off.svg" />
<None Remove="Resources\Images\visibility_on.svg" />
</ItemGroup>
<ItemGroup>
<None Remove="Resources\Fonts\arrow_back_ios_FILL0_wght400_GRAD200_opsz48.svg" />
<None Remove="Resources\Images\default_profile_picture.png" />
</ItemGroup>
<ItemGroup>
<MauiFont Include="Resources\Images\arrow_back.svg" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<MauiXaml Update="Views\ProfilePage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\RecipeView.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\SearchPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties XamarinHotReloadDebuggerTimeoutExceptionShoopNCookHideInfoBar="True" XamarinHotReloadUnhandledDeviceExceptionShoopNCookHideInfoBar="True" /></VisualStudio></ProjectExtensions>
</Project>

@ -49,10 +49,16 @@
<ItemGroup>
<None Remove="Resources\Fonts\Poppins-Bold.ttf" />
<None Remove="Resources\Fonts\Poppins-Medium.ttf" />
<None Remove="Resources\Images\earth_off.svg" />
<None Remove="Resources\Images\earth_on.svg" />
<None Remove="Resources\Images\email_icon.svg" />
<None Remove="Resources\Images\facebook_logo.svg" />
<None Remove="Resources\Images\minus.svg" />
<None Remove="Resources\Images\password_icon.svg" />
<None Remove="Resources\Images\plus.svg" />
<None Remove="Resources\Images\search_options.svg" />
<None Remove="Resources\Images\user.svg" />
<None Remove="Resources\Images\visibility_off.svg" />
<None Remove="Resources\Images\visibility_on.svg" />
</ItemGroup>
@ -74,9 +80,15 @@
<MauiXaml Update="Views\ProfilePage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\RecipePage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\RecipeView.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\RegisterPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\SearchPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>

@ -44,7 +44,6 @@
<Border
Style="{StaticResource SecondaryBorder}"
StrokeShape="RoundRectangle 12"
>
<Grid
Padding="5"

@ -0,0 +1,152 @@
<?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"
x:Class="ShoopNCook.Views.RecipePage"
Title="RecipePage"
BackgroundColor="{StaticResource BackgroundPrimary}">
<Grid
RowDefinitions="90*, 10*"
Padding="10"
>
<!--Main content-->
<ScrollView>
<Grid
RowDefinitions="*, Auto, 10*">
<FlexLayout
Grid.Row="0"
Direction="Row"
JustifyContent="SpaceBetween"
AlignContent="Center"
AlignItems="Center"
>
<ImageButton
Source="arrow_back.svg"/>
<Label
Style="{StaticResource h1}"
Text="Recipe name"/>
<ImageButton
Source="earth_off.svg"
Margin="0, 0, 5, 0"
/>
</FlexLayout>
<!--Recipe image-->
<Border
Grid.Row="1"
Margin="10"
Stroke="Transparent"
StrokeShape="RoundRectangle 20"
BackgroundColor="AliceBlue">
<Image
HeightRequest="250"/>
</Border>
<!--Steps-->
<VerticalStackLayout
Grid.Row="2"
Padding="30, 0, 30, 0">
<Label
Style="{StaticResource h2}"
Text="Ingredients"/>
<VerticalStackLayout>
<Label
Style="{StaticResource Small}"
Text="• Ingredient 1 45 kg"/>
<Label
Style="{StaticResource Small}"
Text="• Ingredient 1 32 g"/>
<Label
Style="{StaticResource Small}"
Text="• Ingredient 1 101 kt"/>
</VerticalStackLayout>
<VerticalStackLayout>
<Label
Style="{StaticResource Small}"
Text="Cooking time: %Cook_Time%"/>
<Label
Style="{StaticResource Small}"
Text="Energy input: %Nb_Cal%/pers"/>
</VerticalStackLayout>
<Label
Style="{StaticResource h2}"
Text="Preparation steps"/>
<VerticalStackLayout>
<Label
Style="{StaticResource Small}"
Text="Step 1 : Frist step"/>
<Label
Style="{StaticResource Small}"
Text="Step 2 : Second step"/>
<Label
Style="{StaticResource Small}"
Text="Step 3 : Third step"/>
</VerticalStackLayout>
</VerticalStackLayout>
</Grid>
</ScrollView>
<!--Footer-->
<FlexLayout
Grid.Row="1"
Direction="Row"
JustifyContent="SpaceBetween"
AlignItems="Center"
>
<Grid
ColumnDefinitions="*, Auto, *">
<Border
Grid.Column="0"
Stroke="Transparent"
StrokeShape="RoundRectangle 100"
BackgroundColor="{StaticResource Selected}">
<Image
Source="minus.svg"
WidthRequest="40"
HeightRequest="40"/>
</Border>
<Label
Grid.Column="1"
Text="%N% pers"
Margin="10, 0, 10, 0"
TextColor="{StaticResource TextColorPrimary}"
VerticalTextAlignment="Center"
FontFamily="PoppinsMedium"/>
<Border
Grid.Column="2"
Stroke="Transparent"
StrokeShape="RoundRectangle 100"
BackgroundColor="{StaticResource Selected}">
<Image
Source="add.svg"
WidthRequest="40"
HeightRequest="40"/>
</Border>
</Grid>
<Button
Grid.Column="1"
Text="Most Recent"
Style="{StaticResource UserButton}"
TextColor="White"
BackgroundColor="Gray">
</Button>
</FlexLayout>
</Grid>
</ContentPage>

@ -0,0 +1,9 @@
namespace ShoopNCook.Views;
public partial class RecipePage : ContentPage
{
public RecipePage()
{
InitializeComponent();
}
}

@ -72,13 +72,13 @@
Grid.Row="3"
ColumnSpacing="10"
ColumnDefinitions="*, *">
<Button
Grid.Column="0"
Text="Most Relevent"
Style="{StaticResource UserButton}"
TextColor="{StaticResource White}"
BackgroundColor="{StaticResource Selected}">
</Button>
<Button
@ -87,7 +87,6 @@
Style="{StaticResource UserButton}"
TextColor="{StaticResource TextColorSecondary}"
BackgroundColor="{StaticResource BackgroundSecondary}">
</Button>
</Grid>

Loading…
Cancel
Save