From e0a061ef9f10ead4547503c5b1c9b5a177f12170 Mon Sep 17 00:00:00 2001 From: "Zach Keeping [SSW]" <11418832+zacharykeeping@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:19:20 +1000 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Mobile=20|=20Settings=20im?= =?UTF-8?q?provements=20on=20tablets=20(#1060)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix popup widths * Add max height * Add title * Add logo to settings on tablets --- .../Common/Messages/TopBarTitleMessage.cs | 5 +++ .../Features/AboutSSW/AboutSswPage.xaml | 2 +- src/MobileUI/Features/AppShell.xaml.cs | 1 + .../Features/OnBoarding/OnBoardingPage.xaml | 4 +- .../Features/Profile/ProfilePicturePage.xaml | 5 +-- .../Features/Redeem/RedeemRewardPage.xaml | 2 +- src/MobileUI/Features/Scanner/ScanPage.xaml | 3 +- .../Features/Settings/SettingsPage.xaml | 39 ++++++++++++------- .../Features/Settings/SettingsPage.xaml.cs | 5 +++ .../Features/Settings/SettingsViewModel.cs | 1 + .../Features/TopBar/TopBarViewModel.cs | 8 ++++ src/MobileUI/Resources/Styles/Templates.xaml | 28 +++++++++---- 12 files changed, 74 insertions(+), 29 deletions(-) create mode 100644 src/MobileUI/Common/Messages/TopBarTitleMessage.cs diff --git a/src/MobileUI/Common/Messages/TopBarTitleMessage.cs b/src/MobileUI/Common/Messages/TopBarTitleMessage.cs new file mode 100644 index 000000000..18f12350f --- /dev/null +++ b/src/MobileUI/Common/Messages/TopBarTitleMessage.cs @@ -0,0 +1,5 @@ +using CommunityToolkit.Mvvm.Messaging.Messages; + +namespace SSW.Rewards.Mobile.Messages; + +public class TopBarTitleMessage(string value) : ValueChangedMessage(value); \ No newline at end of file diff --git a/src/MobileUI/Features/AboutSSW/AboutSswPage.xaml b/src/MobileUI/Features/AboutSSW/AboutSswPage.xaml index a81c7631d..d63cf7d4e 100644 --- a/src/MobileUI/Features/AboutSSW/AboutSswPage.xaml +++ b/src/MobileUI/Features/AboutSSW/AboutSswPage.xaml @@ -20,7 +20,7 @@ EasingOut="SinIn" HasBackgroundAnimation="True" /> - + - + - + - - + + Spacing="30" + MaximumWidthRequest="500"> diff --git a/src/MobileUI/Features/Settings/SettingsPage.xaml b/src/MobileUI/Features/Settings/SettingsPage.xaml index f20976e2d..731b6c9c5 100644 --- a/src/MobileUI/Features/Settings/SettingsPage.xaml +++ b/src/MobileUI/Features/Settings/SettingsPage.xaml @@ -7,19 +7,32 @@ x:DataType="viewModels:SettingsViewModel" ControlTemplate="{DynamicResource PageTemplate}" BackgroundColor="{StaticResource Background}"> - - - + + + + - - - - + + + + - - - - - - + + + + + + + + diff --git a/src/MobileUI/Features/Settings/SettingsPage.xaml.cs b/src/MobileUI/Features/Settings/SettingsPage.xaml.cs index 182d83515..40f77be9c 100644 --- a/src/MobileUI/Features/Settings/SettingsPage.xaml.cs +++ b/src/MobileUI/Features/Settings/SettingsPage.xaml.cs @@ -18,6 +18,11 @@ protected override void OnAppearing() { base.OnAppearing(); _firebaseAnalyticsService.Log("SettingsPage"); + } + + protected override void OnNavigatedTo(NavigatedToEventArgs args) + { + base.OnNavigatedTo(args); SettingsViewModel.Initialise(); } diff --git a/src/MobileUI/Features/Settings/SettingsViewModel.cs b/src/MobileUI/Features/Settings/SettingsViewModel.cs index 4cd50aea8..07408cecd 100644 --- a/src/MobileUI/Features/Settings/SettingsViewModel.cs +++ b/src/MobileUI/Features/Settings/SettingsViewModel.cs @@ -33,6 +33,7 @@ public SettingsViewModel(IUserService userService, ISnackbarService snackbarServ public static void Initialise() { WeakReferenceMessenger.Default.Send(new TopBarAvatarMessage(AvatarOptions.Back)); + WeakReferenceMessenger.Default.Send(new TopBarTitleMessage("SSW Rewards | My Settings")); } [RelayCommand] diff --git a/src/MobileUI/Features/TopBar/TopBarViewModel.cs b/src/MobileUI/Features/TopBar/TopBarViewModel.cs index 92a042f8c..1054f98ed 100644 --- a/src/MobileUI/Features/TopBar/TopBarViewModel.cs +++ b/src/MobileUI/Features/TopBar/TopBarViewModel.cs @@ -27,6 +27,9 @@ public partial class TopBarViewModel : ObservableObject [ObservableProperty] private bool _showScanner = true; + + [ObservableProperty] + private string _title = string.Empty; public TopBarViewModel(IPermissionsService permissionsService, IUserService userService, IScannerService scannerService) { @@ -49,6 +52,11 @@ public TopBarViewModel(IPermissionsService permissionsService, IUserService user break; } }); + + WeakReferenceMessenger.Default.Register(this, (_, m) => + { + Title = m.Value; + }); userService.MyProfilePicObservable().Subscribe(myProfilePage => ProfilePic = myProfilePage); } diff --git a/src/MobileUI/Resources/Styles/Templates.xaml b/src/MobileUI/Resources/Styles/Templates.xaml index bb6cd751e..11914213c 100644 --- a/src/MobileUI/Resources/Styles/Templates.xaml +++ b/src/MobileUI/Resources/Styles/Templates.xaml @@ -12,14 +12,15 @@ - + - @@ -37,6 +38,7 @@ -