Skip to content

Commit

Permalink
Added the settings icon and side menu
Browse files Browse the repository at this point in the history
  • Loading branch information
kubaflo committed Jan 30, 2023
1 parent 252551b commit 9bd5499
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 76 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/GWallet.Frontend.XF.iOS/GWallet.Frontend.XF.iOS.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,12 @@
<HintPath>..\..\packages\Fsdk.0.6.0--date20230118-0634.git-b829db2\lib\netstandard2.0\Fsdk.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\logo_512x512.png" />
</ItemGroup>
<Import Project="..\..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
<Import Project="..\..\packages\Xamarin.Forms.5.0.0.2515\build\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.5.0.0.2515\build\Xamarin.Forms.targets')" />
</Project>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
193 changes: 123 additions & 70 deletions src/GWallet.Frontend.XF/BalancesPage.xaml
Original file line number Diff line number Diff line change
@@ -1,84 +1,137 @@
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
<?xml version="1.0" encoding="utf-8"?>
<FlyoutPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:GWallet.Frontend.XF"
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
ios:FlyoutPage.ApplyShadow="True"
xmlns:controls="clr-namespace:GWallet.Frontend.XF.Controls"
x:Class="GWallet.Frontend.XF.BalancesPage">
<StackLayout x:Name="mainLayout"
Padding="0,0,0,0"
VerticalOptions="FillAndExpand">

<StackLayout Orientation="Horizontal"
Padding="15, 10"
Spacing="30"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand">
<!-- Side menu-->
<FlyoutPage.Flyout>
<ContentPage Title="FlyoutMenu"
ios:Page.UseSafeArea="True" >
<StackLayout Spacing="20" Margin="10,0,15,0">

<!-- we add {V|H}Options=Center* not only to the Label, as a workaround to
https://github.com/xamarin/Xamarin.Forms/issues/4655 -->
<Frame x:Name="totalFiatAmountFrame"
HasShadow="false"
BackgroundColor="Transparent"
BorderColor="Transparent"
VerticalOptions="CenterAndExpand"
HorizontalOptions="End"
Padding="0"
Margin="0,0,0,0">
<StackLayout x:Name="totalFiatAmountLayout"
Orientation="Horizontal"
VerticalOptions="CenterAndExpand"
HorizontalOptions="Center"
Margin="0,0,0,0">
<Label Text="..." x:Name="totalFiatAmountLabel"
VerticalOptions="CenterAndExpand"
HorizontalOptions="Center"
Margin="0,0,0,0"
FontSize="22" />
<Image HeightRequest="80"
WidthRequest="80"
Margin="0,0,0,10"
Source="logo_512x512.png"/>

<StackLayout Spacing="15" Orientation="Horizontal">
<Label TextColor="#BF0C27" VerticalOptions="Center" FontFamily="Icons" Text="&#x23;"/>
<Label Text="Check you still remember your payment password"/>
<StackLayout.GestureRecognizers><TapGestureRecognizer Tapped="OpenSettings_Tapped"/></StackLayout.GestureRecognizers>
</StackLayout>

<StackLayout Spacing="15" Orientation="Horizontal">
<Label TextColor="#BF0C27" VerticalOptions="Center" FontFamily="Icons" Text="&#x23;"/>
<Label Text="Check you still remember your secret recovery phrase"/>
<StackLayout.GestureRecognizers><TapGestureRecognizer Tapped="OpenSettings_Tapped"/></StackLayout.GestureRecognizers>
</StackLayout>
</Frame>

<!-- keep this frame&stacklayout&label below almost same as previous! -->
<Frame x:Name="totalReadOnlyFiatAmountFrame"
HasShadow="false"
IsVisible="false"
BackgroundColor="Transparent"
BorderColor="Transparent"
VerticalOptions="CenterAndExpand"
HorizontalOptions="End"
Padding="0"
Margin="0,0,0,0">
<StackLayout x:Name="totalReadOnlyFiatAmountLayout"
Orientation="Horizontal"
VerticalOptions="CenterAndExpand"
HorizontalOptions="Center"
Margin="0,0,0,0">
<Label Text="..." x:Name="totalReadOnlyFiatAmountLabel"
VerticalOptions="CenterAndExpand"
HorizontalOptions="Center"
Margin="0,0,0,0"
FontSize="22"
TextColor="DarkBlue" />
<StackLayout Spacing="15" Orientation="Horizontal">
<Label TextColor="#BF0C27" VerticalOptions="Center" FontFamily="Icons" Text="&#x23;"/>
<Label Text="Wipe your current wallet, in order to start from scratch"/>
<StackLayout.GestureRecognizers><TapGestureRecognizer Tapped="OpenSettings_Tapped"/></StackLayout.GestureRecognizers>
</StackLayout>
</Frame>
</StackLayout>
</ContentPage>
</FlyoutPage.Flyout>

<!-- Main page-->
<FlyoutPage.Detail>
<ContentPage ios:Page.UseSafeArea="True"
Title="Balances">
<StackLayout x:Name="mainLayout"
Padding="0,0,0,0"
VerticalOptions="FillAndExpand">

<!-- Settings icon-->
<Button BackgroundColor="Transparent"
TextColor="Black"
FontFamily="Icons"
Text="&#xf1de;"
FontSize="20"
HeightRequest="20"
HorizontalOptions="Start"
Margin="20,0"
Clicked="OpenFlyout_Clicked"/>


<StackLayout Orientation="Horizontal"
Padding="15, 10"
Spacing="30"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand">

<!-- we add {V|H}Options=Center* not only to the Label, as a workaround to
https://github.com/xamarin/Xamarin.Forms/issues/4655 -->
<Frame x:Name="totalFiatAmountFrame"
HasShadow="false"
BackgroundColor="Transparent"
BorderColor="Transparent"
VerticalOptions="CenterAndExpand"
HorizontalOptions="End"
Padding="0"
Margin="0,0,0,0">
<StackLayout x:Name="totalFiatAmountLayout"
Orientation="Horizontal"
VerticalOptions="CenterAndExpand"
HorizontalOptions="Center"
Margin="0,0,0,0">
<Label Text="..." x:Name="totalFiatAmountLabel"
VerticalOptions="CenterAndExpand"
HorizontalOptions="Center"
Margin="0,0,0,0"
FontSize="22" />
</StackLayout>
</Frame>

<!-- keep this frame&stacklayout&label below almost same as previous! -->
<Frame x:Name="totalReadOnlyFiatAmountFrame"
HasShadow="false"
IsVisible="false"
BackgroundColor="Transparent"
BorderColor="Transparent"
VerticalOptions="CenterAndExpand"
HorizontalOptions="End"
Padding="0"
Margin="0,0,0,0">
<StackLayout x:Name="totalReadOnlyFiatAmountLayout"
Orientation="Horizontal"
VerticalOptions="CenterAndExpand"
HorizontalOptions="Center"
Margin="0,0,0,0">
<Label Text="..." x:Name="totalReadOnlyFiatAmountLabel"
VerticalOptions="CenterAndExpand"
HorizontalOptions="Center"
Margin="0,0,0,0"
FontSize="22"
TextColor="DarkBlue" />
</StackLayout>
</Frame>

<controls:CircleChartView x:Name="normalChartView"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"/>
<controls:CircleChartView x:Name="normalChartView"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"/>

<controls:CircleChartView x:Name="readonlyChartView"
IsVisible="False"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"/>
<controls:CircleChartView x:Name="readonlyChartView"
IsVisible="False"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"/>

</StackLayout>
</StackLayout>

<ScrollView HorizontalOptions="FillAndExpand">
<StackLayout x:Name="contentLayout" />
</ScrollView>
<ScrollView HorizontalOptions="FillAndExpand">
<StackLayout x:Name="contentLayout" />
</ScrollView>

<Label Text="www.geewallet.com" x:Name="footerLabel"
VerticalOptions="End"
HorizontalOptions="Center"
Margin="0,10,0,10" />
</StackLayout>
</ContentPage>
<Label Text="www.geewallet.com" x:Name="footerLabel"
VerticalOptions="End"
HorizontalOptions="Center"
Margin="0,10,0,10" />
</StackLayout>
</ContentPage>
</FlyoutPage.Detail>
</FlyoutPage>
8 changes: 7 additions & 1 deletion src/GWallet.Frontend.XF/BalancesPage.xaml.fs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type BalancesPage(state: FrontendHelpers.IGlobalAppState,
currencyImages: Map<Currency*bool,Image>,
startWithReadOnlyAccounts: bool)
as this =
inherit ContentPage()
inherit FlyoutPage()

let _ = base.LoadFromXaml(typeof<BalancesPage>)

Expand Down Expand Up @@ -535,3 +535,9 @@ type BalancesPage(state: FrontendHelpers.IGlobalAppState,
this.StopTimer()
this.CancelBalanceRefreshJobs()
)

member this.OpenFlyout_Clicked(_: obj, _: EventArgs) =
this.IsPresented <- true

member this.OpenSettings_Tapped(_: obj, _: EventArgs) =
Application.Current.MainPage.DisplayAlert("Settings", "Succesfully opened the settings page", "Ok") |> ignore
6 changes: 5 additions & 1 deletion src/GWallet.Frontend.XF/GWallet.Frontend.XF.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<EnableDefaultEmbeddedResourceItems>true</EnableDefaultEmbeddedResourceItems>
<Configurations>Release;Debug</Configurations>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Folder Include="Properties\" />
<Folder Include="img\" />
<Folder Include="Controls\" />
<Folder Include="img\" />
<Folder Include="Resources\" />
<Folder Include="Resources\Fonts\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\..\img\btc_grey_60x60.png">
Expand Down Expand Up @@ -141,5 +144,6 @@
<PackageReference Include="Fsdk" Version="0.6.0--date20230118-0634.git-b829db2">
<GeneratePathProperty></GeneratePathProperty>
</PackageReference>
<EmbeddedResource Include="Resources\Fonts\FontAwesomeSolid.otf" />
</ItemGroup>
</Project>
7 changes: 4 additions & 3 deletions src/GWallet.Frontend.XF/Properties/AssemblyInfo.fs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
namespace GWallet.Frontend.XF

open System.Reflection
open System.Runtime.CompilerServices
open Xamarin.Forms

[<assembly: AssemblyTitle("GWallet.Frontend.XF")>]
[<assembly: AssemblyDescription("")>]
[<assembly: AssemblyConfiguration("")>]
[<assembly: AssemblyTrademark("")>]

[<assembly: ExportFont("FontAwesomeSolid.otf", Alias = "Icons")>]
do ()
//[<assembly: AssemblyDelaySign(false)>]
//[<assembly: AssemblyKeyFile("")>]

()

Binary file not shown.

0 comments on commit 9bd5499

Please sign in to comment.