add StepEntry view
continuous-integration/drone/push Build is failing Details

pull/37/head
Maxime BATISTA 2 years ago
parent 32f1fb914b
commit 99c3094987

@ -69,10 +69,12 @@
<Label
Style="{StaticResource h2}"
Text="Ingredient list (for 1 person)"/>
<!--Ingredient entry list-->
<VerticalStackLayout
x:Name="IngredientList"
Spacing="5">
<views:IngredientInput/>
<views:IngredientEntry/>
</VerticalStackLayout>
<!--Add new ingredient button-->
@ -93,9 +95,59 @@
VerticalTextAlignment="Center"/>
</HorizontalStackLayout>
<!--General Informations-->
<Label
Style="{StaticResource h2}"
Text="Informations"/>
<HorizontalStackLayout>
<Label
Style="{StaticResource h3}"
VerticalTextAlignment="Center"
Text="Cook time: "/>
<Entry
Style="{StaticResource UserInput}"
Keyboard="Numeric"
x:Name="CookTimeInput"/>
<Label
Style="{StaticResource h3}"
VerticalTextAlignment="Center"
Text="minutes"/>
</HorizontalStackLayout>
<!--Preparation entry steps list-->
<Label
Style="{StaticResource h2}"
Text="Preparation steps"/>
<!--Step list-->
<VerticalStackLayout
x:Name="StepList"
Spacing="5">
<Entry
Style="{StaticResource UserInput}"
BackgroundColor="{StaticResource BackgroundSecondary}"/>
</VerticalStackLayout>
<!--Add new Step button-->
<HorizontalStackLayout>
<HorizontalStackLayout.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnAddStepTapped"
NumberOfTapsRequired="1"/>
</HorizontalStackLayout.GestureRecognizers>
<Label
Text="+"
TextColor="LightGreen"
FontSize="50"/>
<Label
Margin="0, 10, 0, 0"
Style="{StaticResource h2}"
Text="Add Step"
VerticalTextAlignment="Center"/>
</HorizontalStackLayout>
</VerticalStackLayout>
</VerticalStackLayout>
</ScrollView>

@ -11,6 +11,11 @@ public partial class CreateRecipePage : ContentPage
private void OnAddIngredientTapped(object sender, TappedEventArgs e)
{
IngredientList.Children.Add(new IngredientInput());
IngredientList.Children.Add(new IngredientEntry());
}
private void OnAddStepTapped(object sender, TappedEventArgs e)
{
StepList.Children.Add(new Entry());
}
}

@ -90,6 +90,9 @@
<Compile Update="Pages\MyListPage.xaml.cs">
<DependentUpon>MyListPage.xaml</DependentUpon>
</Compile>
<Compile Update="Views\IngredientEntry.xaml.cs">
<DependentUpon>IngredientEntry.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
@ -105,7 +108,7 @@
<MauiXaml Update="Views\HeadedButton.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\IngredientInput.xaml">
<MauiXaml Update="Views\IngredientEntry.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\IngredientView.xaml">
@ -138,6 +141,9 @@
<MauiXaml Update="Views\SearchPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\StepEntry.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\StoredRecipeView.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ShoopNCook.Views.IngredientInput">
x:Class="ShoopNCook.Views.IngredientEntry">
<Border
Stroke="{StaticResource BackgroundSecondary}"
StrokeThickness="1"

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

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

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ShoopNCook.Views.StepEntry">
<VerticalStackLayout>
<Label
Style="{StaticResource h3}"
Text="Step"/>
<Label
Style="{StaticResource h3}"
x:Name="OrdinalLabel"
Text="{Binding Ordinal}"/>
<Entry
Style="{StaticResource UserInput}"/>
</VerticalStackLayout>
</ContentView>

@ -0,0 +1,15 @@
namespace ShoopNCook.Views;
public partial class StepEntry : ContentView
{
private readonly BindableProperty OrdinalProperty = BindableProperty.Create(nameof(OrdinalLabel), typeof(uint), typeof(StepEntry), default(uint));
public StepEntry()
{
InitializeComponent();
}
public uint Ordinal {
get => (uint)GetValue(OrdinalProperty);
set => SetValue(OrdinalProperty, value);
}
}
Loading…
Cancel
Save