From 41f509c0589aed36d1d492c82453efca0dcf2657 Mon Sep 17 00:00:00 2001 From: kubaflo <42434498+kubaflo@users.noreply.github.com> Date: Tue, 31 Jan 2023 01:22:54 +0100 Subject: [PATCH] Frontend.XF: added the side menu & settings page Added the settings page, the settings icon and side menu. --- img/settings_80x80.png | Bin 0 -> 768 bytes .../Resources/Resource.designer.cs | 2 +- src/GWallet.Frontend.XF/BalancesPage.xaml | 69 +++++++++- src/GWallet.Frontend.XF/BalancesPage.xaml.fs | 14 +- .../GWallet.Frontend.XF.fsproj | 7 + src/GWallet.Frontend.XF/SettingsPage.xaml | 129 ++++++++++++++++++ src/GWallet.Frontend.XF/SettingsPage.xaml.fs | 70 ++++++++++ 7 files changed, 284 insertions(+), 7 deletions(-) create mode 100644 img/settings_80x80.png create mode 100644 src/GWallet.Frontend.XF/SettingsPage.xaml create mode 100644 src/GWallet.Frontend.XF/SettingsPage.xaml.fs diff --git a/img/settings_80x80.png b/img/settings_80x80.png new file mode 100644 index 0000000000000000000000000000000000000000..564d39b54c06926c782029bd92002e10b939f582 GIT binary patch literal 768 zcmV+b1ONPqP)eY-1Um?H zfEC2N=wqY;wSwrQPoaa@fs{ZAlt2gO-?)=u7+03t-aKb!hY^Fqm;En$T>o~vc~F1N zfB*mi5C8!X0zd!+KmddQ5C8!X03iSbKmdFh&4*m<`@V4xbUvR$I(*ScXjC*VG}6sx zQ$4$`udzILX*LkNfDTt0AwR`lulVa2A>6K{2CuG&;4T2LUE!1W0swTai156_682W} zbL3PcV#)h$Rtr{KQW}}^8OZa>*78Xd@T#pPgabz+G0*~#!Y1c^mhC!f%Yg)ONueBR z22geQ+h(q;=oyOjdabXK<}=X>jeW1KwJ{~kgkib}!nv3#N}K}74THEb6AKz2Q+=mD zWP6*5ZcL*`Wd%Yitow3M3b5-#sg%(G2^@1tzH1FD%SX#LkIn{wGX`$u;;Omj zInZIRJcRkoNgSvJJ6$=j^4w6R1t8CHM+e}g#xCV3%=b@1BsRqgGq#a-T{A@?B2oc> z?aBlYk0z~!jRjcq=QQx396KV}0!`y{!Xn z%zX<+(|Cw@ujyl@xJ<^g - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/GWallet.Frontend.XF/BalancesPage.xaml.fs b/src/GWallet.Frontend.XF/BalancesPage.xaml.fs index c08c66769..8ca519d43 100644 --- a/src/GWallet.Frontend.XF/BalancesPage.xaml.fs +++ b/src/GWallet.Frontend.XF/BalancesPage.xaml.fs @@ -34,7 +34,7 @@ type BalancesPage(state: FrontendHelpers.IGlobalAppState, currencyImages: Map, startWithReadOnlyAccounts: bool) as self = - inherit ContentPage() + inherit FlyoutPage() let _ = base.LoadFromXaml(typeof) @@ -46,6 +46,8 @@ type BalancesPage(state: FrontendHelpers.IGlobalAppState, let contentLayout = base.FindByName "contentLayout" let normalChartView = base.FindByName "normalChartView" let readonlyChartView = base.FindByName "readonlyChartView" + let sideMenuImg = base.FindByName "sideMenuImg" + let settingsImgBtn = base.FindByName "settingsImgBtn" let standardTimeToRefreshBalances = TimeSpan.FromMinutes 5.0 let standardTimeToRefreshBalancesWhenThereIsImminentIncomingPaymentOrNotEnoughInfoToKnow = TimeSpan.FromMinutes 1.0 @@ -500,6 +502,8 @@ type BalancesPage(state: FrontendHelpers.IGlobalAppState, member private self.Init () = normalChartView.DefaultImageSource <- FrontendHelpers.GetSizedImageSource "logo" 512 readonlyChartView.DefaultImageSource <- FrontendHelpers.GetSizedImageSource "logo" 512 + sideMenuImg.Source <- FrontendHelpers.GetSizedImageSource "logo" 512 + settingsImgBtn.Source <- FrontendHelpers.GetSizedImageSource "settings" 80 let tapGestureRecognizer = TapGestureRecognizer() tapGestureRecognizer.Tapped.Subscribe(fun _ -> @@ -535,3 +539,11 @@ type BalancesPage(state: FrontendHelpers.IGlobalAppState, self.StopTimer() self.CancelBalanceRefreshJobs() ) + + member self.OpenFlyoutClicked(_sender: obj, _evArgs: EventArgs) = + self.IsPresented <- true + + member self.OpenSettingsTapped(_sender: obj, evArgs: EventArgs) = + let title = (evArgs :?> TappedEventArgs).Parameter :?> string + let settingsPage () = SettingsPage title :> Page + FrontendHelpers.SwitchToNewPage self settingsPage true diff --git a/src/GWallet.Frontend.XF/GWallet.Frontend.XF.fsproj b/src/GWallet.Frontend.XF/GWallet.Frontend.XF.fsproj index 0cfc7078e..8b1d7f003 100644 --- a/src/GWallet.Frontend.XF/GWallet.Frontend.XF.fsproj +++ b/src/GWallet.Frontend.XF/GWallet.Frontend.XF.fsproj @@ -67,6 +67,9 @@ img\eth_grey_120x120.png + + img\settings_80x80.png + img\eth_red_60x60.png @@ -103,6 +106,10 @@ SendPage.xaml Code + + SettingsPage.xaml + Code + PairingToPage.xaml Code diff --git a/src/GWallet.Frontend.XF/SettingsPage.xaml b/src/GWallet.Frontend.XF/SettingsPage.xaml new file mode 100644 index 000000000..e60205ea1 --- /dev/null +++ b/src/GWallet.Frontend.XF/SettingsPage.xaml @@ -0,0 +1,129 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/GWallet.Frontend.XF/SettingsPage.xaml.fs b/src/GWallet.Frontend.XF/SettingsPage.xaml.fs new file mode 100644 index 000000000..49ff8578d --- /dev/null +++ b/src/GWallet.Frontend.XF/SettingsPage.xaml.fs @@ -0,0 +1,70 @@ +namespace GWallet.Frontend.XF + +open System +open System.Linq + +open Xamarin.Forms +open Xamarin.Forms.Xaml +open Fsdk + +open GWallet.Backend + +type SettingsPage(option: string) as this = + inherit ContentPage() + let _ = base.LoadFromXaml(typeof) + let titleLabel = base.FindByName