Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions TransactionMobile.Maui/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,6 @@
xmlns:local="clr-namespace:TransactionMobile.Maui"
x:Class="TransactionMobile.Maui.App">
<Application.Resources>
<ResourceDictionary>

<Color x:Key="PrimaryColor">#512bdf</Color>
<Color x:Key="SecondaryColor">White</Color>

<Style TargetType="Label">
<Setter Property="TextColor" Value="{DynamicResource PrimaryColor}" />
<Setter Property="FontFamily" Value="OpenSansRegular" />
</Style>

<Style TargetType="Button">
<Setter Property="TextColor" Value="{DynamicResource SecondaryColor}" />
<Setter Property="FontFamily" Value="OpenSansRegular" />
<Setter Property="BackgroundColor" Value="{DynamicResource PrimaryColor}" />
<Setter Property="Padding" Value="14,10" />
</Style>

</ResourceDictionary>
<ResourceDictionary Source="Resources/Styles/LightTheme.xaml"/>
</Application.Resources>
</Application>
50 changes: 44 additions & 6 deletions TransactionMobile.Maui/Pages/LoginPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,49 @@
Shell.FlyoutItemIsVisible="False"
BackgroundColor="White">
<ContentPage.Content>
<StackLayout>
<Button Text="Login"
Command="{Binding LoginCommand}"
HorizontalOptions="CenterAndExpand"
VerticalOptions="CenterAndExpand" />
</StackLayout>
<!-- Main structure-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<!--Main image-->
<Image Grid.RowSpan="2" Grid.Row="0" Source="Resources/loginimage.jpg" VerticalOptions="Start" Aspect="AspectFit"/>

<!-- Title-->
<Label Grid.Row="1" Text="Log In" FontSize="34" VerticalOptions="End" FontAttributes="Bold" Padding="20,0,0,20"/>

<Frame Grid.Row="2" HasShadow="True" Padding="25,50" Margin="10,0,10,10" VerticalOptions="CenterAndExpand"
CornerRadius="20" Opacity="0.9" BackgroundColor="#E5E9F0">
<Grid ColumnDefinitions="Auto,*">
<Grid.RowDefinitions>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
</Grid.RowDefinitions>

<Entry x:Name="UserNameEntry"
Grid.Row="0"
Placeholder="User name or email address"
AutomationId="UserNameEntry"
Style="{DynamicResource UserNameEntryStyle}"
Grid.ColumnSpan="2">
</Entry>

<Entry x:Name="PasswordEntry"
Grid.Row="1"
Placeholder="******"
AutomationId="PasswordEntry"
Style="{DynamicResource PasswordEntryStyle}"
Grid.ColumnSpan="2">
</Entry>

<Button Grid.ColumnSpan="2" Grid.Row="2" Text="Continue" Style="{StaticResource StandardButton}" Command="{Binding LoginCommand}"/>
<Label Grid.ColumnSpan="2" Grid.Row="3" Text="Forgot your password?" TextColor="{StaticResource P}" FontAttributes="Bold"/>
</Grid>
</Frame>
</Grid>
</ContentPage.Content>
</ContentPage>
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<?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="TransactionMobile.Maui.MobileTopupFailedPage"
Title="{Binding Title}"
BackgroundColor="White">
<StackLayout>
<Label
Margin="0,40,0,0"
Style="{StaticResource LabelStyle}"
HorizontalTextAlignment="Center"
AutomationId="MobileTopupFailed"
Text="MOBILE TOPUP FAILURE" />
x:Class="TransactionMobile.Maui.MobileTopupFailedPage" Title="{Binding Title}"
Shell.NavBarIsVisible="False" BackgroundColor="White">
<VerticalStackLayout x:Name="MainLayout">
<Label Text="{Binding Title}" FontSize="24" HorizontalOptions="Center" VerticalOptions="End"
FontAttributes="Bold" Padding="20,0,0,20"/>
<Frame HasShadow="True" Padding="25,50" Margin="10,0,10,10" VerticalOptions="CenterAndExpand" CornerRadius="20"
Opacity="0.9" BackgroundColor="#E5E9F0">
<VerticalStackLayout Spacing="10">

<Button
x:Name="CancelButton"
Grid.Row="5"
Margin="0,16"
MinimumWidthRequest="250"
WidthRequest="400"
Text="Cancel"
Command="{Binding CancelledCommand}"
AutomationId="CancelButton"/>
</StackLayout>
<Image Source="Resources/PaymentFailure.svg" VerticalOptions="Start" Aspect="AspectFit"/>

<Label Margin="17,8"
Text="Unfortunately, we could not process your mobile top-up, this may be for a variety of reasons. If you wish you can retry the transaction."/>

<Button x:Name="CancelButton" Grid.Row="5" Margin="0,16"
Text="Cancel" Command="{Binding CancelledCommand}"
Style="{DynamicResource MobileTopupButtonStyle}" AutomationId="CancelButton"/>
</VerticalStackLayout>
</Frame>
</VerticalStackLayout>
</ContentPage>
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,58 @@
x:Class="TransactionMobile.Maui.MobileTopupPerformTopupPage"
xmlns:behaviors="clr-namespace:CommunityToolkit.Maui.Behaviors;assembly=CommunityToolkit.Maui"
Title="{Binding Title}"
Shell.NavBarIsVisible="False"
BackgroundColor="White">
<StackLayout>
<Entry x:Name="CustomerMobileNumberEntry"
<VerticalStackLayout x:Name="MainLayout">
<Label Text="{Binding Title}" FontSize="24" HorizontalOptions="Center" VerticalOptions="End" FontAttributes="Bold" Padding="20,0,0,20"/>
<Frame HasShadow="True" Padding="25,50" Margin="10,0,10,10" VerticalOptions="CenterAndExpand"
CornerRadius="20" Opacity="0.9" BackgroundColor="#E5E9F0">
<VerticalStackLayout Spacing="10">
<Entry x:Name="CustomerMobileNumberEntry"
Placeholder="Customer Mobile Number"
Style="{DynamicResource MobileNumberEntryStyle}"
AutomationId="CustomerMobileNumberEntry"
Text="{Binding CustomerMobileNumber}"
Keyboard="Numeric">
<Entry.Behaviors>
<behaviors:EventToCommandBehavior
<Entry.Behaviors>
<behaviors:EventToCommandBehavior
EventName="Completed"
Command="{Binding CustomerMobileNumberEntryCompletedCommand}" />
</Entry.Behaviors>
</Entry>

<Entry x:Name="TopupAmountEntry"
</Entry.Behaviors>
</Entry>
<Entry x:Name="TopupAmountEntry"
Placeholder="100"
AutomationId="TopupAmountEntry"
Style="{DynamicResource AmountEntryStyle}"
Text="{Binding TopupAmount}"
Keyboard="Numeric">
<Entry.Behaviors>
<behaviors:EventToCommandBehavior
<Entry.Behaviors>
<behaviors:EventToCommandBehavior
EventName="Completed"
Command="{Binding TopupAmountEntryCompletedCommand}" />
</Entry.Behaviors>
</Entry>

<Entry x:Name="CustomerEmailAddressEntry"
</Entry.Behaviors>
</Entry>
<Entry x:Name="CustomerEmailAddressEntry"
Placeholder="customeremail@email.com"
AutomationId="CustomerEmailAddressEntry"
Style="{DynamicResource EmailAddressEntryStyle}"
Text="{Binding CustomerEmailAddress}">
<Entry.Behaviors>
<behaviors:EventToCommandBehavior
<Entry.Behaviors>
<behaviors:EventToCommandBehavior
EventName="Completed"
Command="{Binding CustomerEmailAddressEntryCompletedCommand}" />
</Entry.Behaviors>
</Entry>

<Button x:Name="PerformTopupButton"
</Entry.Behaviors>
</Entry>
<Button x:Name="PerformTopupButton"
Text="Perform Topup"
Style="{DynamicResource MobileTopupButtonStyle}"
Command="{Binding PerformTopupCommand}"
AutomationId="PerformTopupButton"/>
</StackLayout>
<!--Style="{DynamicResource MobileTopupButtonStyle}"-->
</VerticalStackLayout>
</Frame>
</VerticalStackLayout>
</ContentPage>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public MobileTopupPerformTopupPage(MobileTopupPerformTopupPageViewModel vm)
BindingContext = vm;
vm.OnCustomerMobileNumberEntryCompleted = () =>
{
if (this.TopupAmountEntry.IsEnabled)
if (this.TopupAmountEntry.IsReadOnly)
{
this.TopupAmountEntry.Focus();
}
Expand All @@ -37,7 +37,7 @@ protected override async void OnAppearing()
base.OnAppearing();
if (viewModel.TopupAmount > 0)
{
this.TopupAmountEntry.IsEnabled = false;
this.TopupAmountEntry.IsReadOnly = true;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TransactionMobile.Maui.MobileTopupSelectOperatorPage"
Title="{Binding Title}"
Shell.NavBarIsVisible="False"
BackgroundColor="White">
<StackLayout>
<Grid x:Name="OperatorGrid" HorizontalOptions="CenterAndExpand" VerticalOptions="FillAndExpand">
</Grid>
</StackLayout>
<VerticalStackLayout x:Name="MainLayout">
<Label Text="{Binding Title}" FontSize="24" HorizontalOptions="Center" VerticalOptions="End" FontAttributes="Bold" Padding="20,0,0,20"/>
<Frame HasShadow="True" Padding="25,50" Margin="10,0,10,10" VerticalOptions="CenterAndExpand"
CornerRadius="20" Opacity="0.9" BackgroundColor="#E5E9F0">
<VerticalStackLayout x:Name="OperatorList" Spacing="10">
</VerticalStackLayout>
</Frame>
</VerticalStackLayout>
</ContentPage>
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,7 @@ protected override async void OnAppearing()

private void LoadOperators(MobileTopupSelectOperatorPageViewModel viewModel)
{
RowDefinitionCollection rowDefinitionCollection = new RowDefinitionCollection();
for (Int32 i = 0; i < viewModel.Operators.Count; i++)
{
rowDefinitionCollection.Add(new RowDefinition
{
Height = 60
});
}

this.OperatorGrid.RowDefinitions = rowDefinitionCollection;
this.OperatorList.Children.Clear();

Int32 rowCount = 0;
foreach (ContractOperatorModel modelOperator in viewModel.Operators)
Expand All @@ -42,7 +33,7 @@ private void LoadOperators(MobileTopupSelectOperatorPageViewModel viewModel)
HorizontalOptions = LayoutOptions.FillAndExpand,
AutomationId = modelOperator.OperatorName,
};
//button.SetDynamicResource(VisualElement.StyleProperty, "MobileTopupButtonStyle");
button.SetDynamicResource(VisualElement.StyleProperty, "MobileTopupButtonStyle");
Binding commandParameter = new Binding()
{
Source = new ItemSelected<ContractOperatorModel>(){
Expand All @@ -58,8 +49,8 @@ private void LoadOperators(MobileTopupSelectOperatorPageViewModel viewModel)

button.SetBinding(Button.CommandProperty, command);
button.SetBinding(Button.CommandParameterProperty, commandParameter);

this.OperatorGrid.Add(button, 0, rowCount);
this.OperatorList.Children.Add(button);

rowCount++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TransactionMobile.Maui.MobileTopupSelectProductPage"
Title="{Binding Title}"
Shell.NavBarIsVisible="False"
BackgroundColor="White">
<StackLayout>
<Grid x:Name="ProductsGrid" HorizontalOptions="CenterAndExpand" VerticalOptions="FillAndExpand">
</Grid>
</StackLayout>
<VerticalStackLayout x:Name="MainLayout">
<Label Text="{Binding Title}" FontSize="24" HorizontalOptions="Center" VerticalOptions="End" FontAttributes="Bold" Padding="20,0,0,20"/>
<Frame HasShadow="True" Padding="25,50" Margin="10,0,10,10" VerticalOptions="CenterAndExpand"
CornerRadius="20" Opacity="0.9" BackgroundColor="#E5E9F0">

<VerticalStackLayout x:Name="ProductsList" Spacing="10">
</VerticalStackLayout>
</Frame>
</VerticalStackLayout>
</ContentPage>
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,8 @@ protected override async void OnAppearing()

private void LoadProducts(MobileTopupSelectProductPageViewModel viewModel)
{
RowDefinitionCollection rowDefinitionCollection = new RowDefinitionCollection();
for (Int32 i = 0; i < viewModel.Products.Count; i++)
{
rowDefinitionCollection.Add(new RowDefinition
{
Height = 60
});
}

this.ProductsGrid.RowDefinitions = rowDefinitionCollection;

this.ProductsList.Clear();

Int32 rowCount = 0;
foreach (ContractProductModel modelProduct in viewModel.Products)
{
Expand All @@ -42,7 +33,7 @@ private void LoadProducts(MobileTopupSelectProductPageViewModel viewModel)
HorizontalOptions = LayoutOptions.FillAndExpand,
AutomationId = modelProduct.ProductDisplayText,
};
//button.SetDynamicResource(VisualElement.StyleProperty, "MobileTopupButtonStyle");
button.SetDynamicResource(VisualElement.StyleProperty, "MobileTopupButtonStyle");

Binding commandParameter = new Binding()
{
Expand All @@ -61,7 +52,7 @@ private void LoadProducts(MobileTopupSelectProductPageViewModel viewModel)
button.SetBinding(Button.CommandProperty, command);
button.SetBinding(Button.CommandParameterProperty, commandParameter);

this.ProductsGrid.Add(button, 0, rowCount);
this.ProductsList.Add(button);

rowCount++;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<?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="TransactionMobile.Maui.MobileTopupSuccessPage"
Title="{Binding Title}"
BackgroundColor="White">
<StackLayout>
<Label
Margin="0,40,0,0"
Style="{StaticResource LabelStyle}"
HorizontalTextAlignment="Center"
AutomationId="MobileTopupSuccessful"
Text="MOBILE TOPUP SUCCESSFUL" />
x:Class="TransactionMobile.Maui.MobileTopupSuccessPage" Title="{Binding Title}"
Shell.NavBarIsVisible="False" BackgroundColor="White">
<VerticalStackLayout x:Name="MainLayout">
<Label Text="{Binding Title}" FontSize="24" HorizontalOptions="Center" VerticalOptions="End"
FontAttributes="Bold" Padding="20,0,0,20"/>
<Frame HasShadow="True" Padding="25,50" Margin="10,0,10,10" VerticalOptions="CenterAndExpand" CornerRadius="20"
Opacity="0.9" BackgroundColor="#E5E9F0">
<VerticalStackLayout Spacing="10">

<!-- Payment description label -->
<Label
Margin="17,8"
Text="Thank you for your topup. An automated payment receipt will be sent to your email entered." />
<Image Source="Resources/PaymentSuccess.svg" VerticalOptions="Start" Aspect="AspectFit"/>

<Button
x:Name="CompleteButton"
Margin="0,16"
MinimumWidthRequest="250"
WidthRequest="250"
Text="Complete"
Command="{Binding CompletedCommand}"
AutomationId="CompleteButton"/>
</StackLayout>
<!-- Payment description label -->
<Label Margin="17,8"
Text="Thank you for your topup. An automated payment receipt will be sent to your email entered."/>

<Button x:Name="CompleteButton" Margin="0,16" Text="Complete" Command="{Binding CompletedCommand}"
Style="{DynamicResource MobileTopupButtonStyle}" AutomationId="CompleteButton"/>
</VerticalStackLayout>
</Frame>
</VerticalStackLayout>
</ContentPage>
Loading