diff --git a/src/App/Pages/Tools/ToolsExtensionPage.cs b/src/App/Pages/Tools/ToolsExtensionPage.cs index 1541a1f73..26ebb492e 100644 --- a/src/App/Pages/Tools/ToolsExtensionPage.cs +++ b/src/App/Pages/Tools/ToolsExtensionPage.cs @@ -58,8 +58,8 @@ namespace Bit.App.Pages var notStartedButton = new Button { Text = "Enable App Extension", - Command = new Command(() => ActivateExtension()), - VerticalOptions = LayoutOptions.End, + Command = new Command(() => ShowExtension()), + VerticalOptions = LayoutOptions.EndAndExpand, HorizontalOptions = LayoutOptions.Fill, Style = (Style)Application.Current.Resources["btn-primary"] }; @@ -105,8 +105,8 @@ namespace Bit.App.Pages var notActivatedButton = new Button { Text = "Enable App Extension", - Command = new Command(() => ActivateExtension()), - VerticalOptions = LayoutOptions.End, + Command = new Command(() => ShowExtension()), + VerticalOptions = LayoutOptions.EndAndExpand, HorizontalOptions = LayoutOptions.Fill, Style = (Style)Application.Current.Resources["btn-primary"] }; @@ -139,7 +139,8 @@ namespace Bit.App.Pages VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.Center, HorizontalTextAlignment = TextAlignment.Center, - LineBreakMode = LineBreakMode.WordWrap + LineBreakMode = LineBreakMode.WordWrap, + Margin = new Thickness(0, 10, 0, 0) }; var activatedImage = new Image @@ -153,17 +154,26 @@ namespace Bit.App.Pages { Text = "See Supported Apps", Command = new Command(() => Device.OpenUri(new Uri("https://bitwarden.com"))), - VerticalOptions = LayoutOptions.End, + VerticalOptions = LayoutOptions.EndAndExpand, HorizontalOptions = LayoutOptions.Fill, Style = (Style)Application.Current.Resources["btn-primary"] }; + var activatedButtonReenable = new Button + { + Text = "Re-enable App Extension", + Command = new Command(() => ShowExtension()), + VerticalOptions = LayoutOptions.End, + HorizontalOptions = LayoutOptions.Fill, + Style = (Style)Application.Current.Resources["btn-primaryAccent"] + }; + var activatedStackLayout = new StackLayout { Orientation = StackOrientation.Vertical, - Spacing = 20, + Spacing = 10, Padding = new Thickness(30, 40), - Children = { activatedLabel, activatedSublabel, activatedImage, activatedButton } + Children = { activatedLabel, activatedSublabel, activatedImage, activatedButton, activatedButtonReenable } }; activatedStackLayout.SetBinding(IsVisibleProperty, m => m.StartedAndActivated); @@ -181,17 +191,20 @@ namespace Bit.App.Pages Title = "App Extension"; Content = stackLayout; BindingContext = Model; - - MessagingCenter.Subscribe(Application.Current, "EnabledAppExtension", (sender, enabled) => - { - Model.Started = true; - Model.Activated = enabled; - }); } - private void ActivateExtension() + private void ShowExtension() { - MessagingCenter.Send(Application.Current, "ShowAppExtension"); + MessagingCenter.Send(Application.Current, "ShowAppExtension", this); + } + + public void EnabledExtension(bool enabled) + { + Model.Started = true; + if(!Model.Activated && enabled) + { + Model.Activated = enabled; + } } } } diff --git a/src/App/Pages/Tools/ToolsPasswordGeneratorPage.cs b/src/App/Pages/Tools/ToolsPasswordGeneratorPage.cs index 5cf5a7509..f7e279fa8 100644 --- a/src/App/Pages/Tools/ToolsPasswordGeneratorPage.cs +++ b/src/App/Pages/Tools/ToolsPasswordGeneratorPage.cs @@ -65,7 +65,6 @@ namespace Bit.App.Pages EnableScrolling = false, Intent = TableIntent.Settings, HasUnevenRows = true, - NoFooter = true, Root = new TableRoot { new TableSection diff --git a/src/iOS/AppDelegate.cs b/src/iOS/AppDelegate.cs index 6aacf26c4..8f16e3209 100644 --- a/src/iOS/AppDelegate.cs +++ b/src/iOS/AppDelegate.cs @@ -23,6 +23,7 @@ using Bit.iOS.Core.Services; using PushNotification.Plugin; using Plugin.DeviceInfo; using Plugin.Connectivity.Abstractions; +using Bit.App.Pages; namespace Bit.iOS { @@ -52,7 +53,7 @@ namespace Bit.iOS UINavigationBar.Appearance.ShadowImage = new UIImage(); UINavigationBar.Appearance.SetBackgroundImage(new UIImage(), UIBarMetrics.Default); - MessagingCenter.Subscribe(Xamarin.Forms.Application.Current, "ShowAppExtension", (sender) => + MessagingCenter.Subscribe(Xamarin.Forms.Application.Current, "ShowAppExtension", (sender, page) => { var itemProvider = new NSItemProvider(new NSDictionary(), "com.8bit.bitwarden.extension-setup"); var extensionItem = new NSExtensionItem(); @@ -60,8 +61,7 @@ namespace Bit.iOS var activityViewController = new UIActivityViewController(new NSExtensionItem[] { extensionItem }, null); activityViewController.CompletionHandler = (activityType, completed) => { - MessagingCenter.Send(Xamarin.Forms.Application.Current, "EnabledAppExtension", - completed && activityType == "com.8bit.bitwarden.find-login-action-extension"); + page.EnabledExtension(completed && activityType == "com.8bit.bitwarden.find-login-action-extension"); }; UIApplication.SharedApplication.KeyWindow.RootViewController.ModalViewController diff --git a/src/iOS/Resources/refresh.png b/src/iOS/Resources/refresh.png index 5ddde5968..8a5833794 100644 Binary files a/src/iOS/Resources/refresh.png and b/src/iOS/Resources/refresh.png differ diff --git a/src/iOS/Resources/refresh@2x.png b/src/iOS/Resources/refresh@2x.png index 9c264dd74..687eabc3a 100644 Binary files a/src/iOS/Resources/refresh@2x.png and b/src/iOS/Resources/refresh@2x.png differ diff --git a/src/iOS/Resources/refresh@3x.png b/src/iOS/Resources/refresh@3x.png index 1778dc218..f492ee5c7 100644 Binary files a/src/iOS/Resources/refresh@3x.png and b/src/iOS/Resources/refresh@3x.png differ