From 230722945eadf67aed0ac53390a5342dac3df051 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 8 Feb 2017 19:18:34 -0500 Subject: [PATCH] move settings pages to modals instead of navigation pages --- src/App/Pages/Settings/SettingsAboutPage.cs | 5 +++++ src/App/Pages/Settings/SettingsHelpPage.cs | 5 +++++ src/App/Pages/Settings/SettingsListFoldersPage.cs | 5 +++++ src/App/Pages/Settings/SettingsPage.cs | 13 +++++++------ src/App/Pages/Settings/SettingsPinPage.cs | 5 +++++ src/App/Pages/Settings/SettingsSyncPage.cs | 5 +++++ 6 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/App/Pages/Settings/SettingsAboutPage.cs b/src/App/Pages/Settings/SettingsAboutPage.cs index 56738cc4e..22d098867 100644 --- a/src/App/Pages/Settings/SettingsAboutPage.cs +++ b/src/App/Pages/Settings/SettingsAboutPage.cs @@ -74,6 +74,11 @@ namespace Bit.App.Pages Spacing = 0 }; + if(Device.OS == TargetPlatform.iOS) + { + ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Cancel)); + } + Title = AppResources.About; Content = new ScrollView { Content = stackLayout }; } diff --git a/src/App/Pages/Settings/SettingsHelpPage.cs b/src/App/Pages/Settings/SettingsHelpPage.cs index f4cb15561..de9963516 100644 --- a/src/App/Pages/Settings/SettingsHelpPage.cs +++ b/src/App/Pages/Settings/SettingsHelpPage.cs @@ -104,6 +104,11 @@ namespace Bit.App.Pages bugLabel.WidthRequest = stackLayout.Bounds.Width - bugLabel.Bounds.Left * 2; }; + if(Device.OS == TargetPlatform.iOS) + { + ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Cancel)); + } + Title = AppResources.HelpAndFeedback; Content = new ScrollView { Content = stackLayout }; } diff --git a/src/App/Pages/Settings/SettingsListFoldersPage.cs b/src/App/Pages/Settings/SettingsListFoldersPage.cs index 472dcd9bb..92515697e 100644 --- a/src/App/Pages/Settings/SettingsListFoldersPage.cs +++ b/src/App/Pages/Settings/SettingsListFoldersPage.cs @@ -38,6 +38,11 @@ namespace Bit.App.Pages listView.ItemSelected += FolderSelected; listView.ItemTemplate = new DataTemplate(() => new SettingsFolderListViewCell(this)); + if(Device.OS == TargetPlatform.iOS) + { + ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Cancel)); + } + Title = AppResources.Folders; Content = listView; } diff --git a/src/App/Pages/Settings/SettingsPage.cs b/src/App/Pages/Settings/SettingsPage.cs index 34c987601..60c371c69 100644 --- a/src/App/Pages/Settings/SettingsPage.cs +++ b/src/App/Pages/Settings/SettingsPage.cs @@ -244,12 +244,12 @@ namespace Bit.App.Pages private void SyncCell_Tapped(object sender, EventArgs e) { - Navigation.PushAsync(new SettingsSyncPage()); + Navigation.PushModalAsync(new ExtendedNavigationPage(new SettingsSyncPage())); } private void AboutCell_Tapped(object sender, EventArgs e) { - Navigation.PushAsync(new SettingsAboutPage()); + Navigation.PushModalAsync(new ExtendedNavigationPage(new SettingsAboutPage())); } private void RateCell_Tapped(object sender, EventArgs e) @@ -268,7 +268,7 @@ namespace Bit.App.Pages private void HelpCell_Tapped(object sender, EventArgs e) { - Navigation.PushAsync(new SettingsHelpPage()); + Navigation.PushModalAsync(new ExtendedNavigationPage(new SettingsHelpPage())); } private void LockCell_Tapped(object sender, EventArgs e) @@ -342,7 +342,7 @@ namespace Bit.App.Pages cell.On = false; var pinPage = new SettingsPinPage(); pinPage.OnPinEntered += PinEntered; - Navigation.PushAsync(pinPage); + Navigation.PushModalAsync(new ExtendedNavigationPage(pinPage)); } else if(!cell.On) { @@ -353,7 +353,8 @@ namespace Bit.App.Pages private void PinEntered(object sender, EventArgs args) { var page = sender as SettingsPinPage; - page.Navigation.PopAsync(); + page.PinControl.Entry.Unfocus(); + page.Navigation.PopModalAsync(); _authService.PIN = page.Model.PIN; @@ -369,7 +370,7 @@ namespace Bit.App.Pages private void FoldersCell_Tapped(object sender, EventArgs e) { - Navigation.PushAsync(new SettingsListFoldersPage()); + Navigation.PushModalAsync(new ExtendedNavigationPage(new SettingsListFoldersPage())); } private string GetLockOptionsDetailsText() diff --git a/src/App/Pages/Settings/SettingsPinPage.cs b/src/App/Pages/Settings/SettingsPinPage.cs index 1c522c3c1..cb07571a3 100644 --- a/src/App/Pages/Settings/SettingsPinPage.cs +++ b/src/App/Pages/Settings/SettingsPinPage.cs @@ -56,6 +56,11 @@ namespace Bit.App.Pages PinControl.Label.GestureRecognizers.Add(tgr); instructionLabel.GestureRecognizers.Add(tgr); + if(Device.OS == TargetPlatform.iOS) + { + ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Cancel)); + } + Title = AppResources.SetPIN; Content = stackLayout; Content.GestureRecognizers.Add(tgr); diff --git a/src/App/Pages/Settings/SettingsSyncPage.cs b/src/App/Pages/Settings/SettingsSyncPage.cs index 48db5749e..2fbc67800 100644 --- a/src/App/Pages/Settings/SettingsSyncPage.cs +++ b/src/App/Pages/Settings/SettingsSyncPage.cs @@ -57,6 +57,11 @@ namespace Bit.App.Pages Padding = new Thickness(15, 0) }; + if(Device.OS == TargetPlatform.iOS) + { + ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Cancel)); + } + Title = AppResources.Sync; Content = stackLayout; }