From d1e4e8645a1e7159d87459327a4ffb208e467ed0 Mon Sep 17 00:00:00 2001 From: Federico Maccaroni Date: Wed, 10 Jan 2024 19:53:53 -0300 Subject: [PATCH] PM-3350 Updated MauiVersion to 8.0.4-nightly.* to have the TapGestureRecognizer fix applied. This is done on the Directory.Build.props so we don't have to change it on every csproj. Also removed the workaround of TapGestureHack and fix the Show environment picker to work on the extensions as well. --- Directory.Build.props | 5 ++ src/Core/Pages/Accounts/HomePageViewModel.cs | 2 +- ...alProviderViewController.TapGestureHack.cs | 51 ------------------- .../CredentialProviderViewController.cs | 4 +- src/iOS.Autofill/iOS.Autofill.csproj | 3 +- 5 files changed, 9 insertions(+), 56 deletions(-) create mode 100644 Directory.Build.props delete mode 100644 src/iOS.Autofill/CredentialProviderViewController.TapGestureHack.cs diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 000000000..bf789590a --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,5 @@ + + + 8.0.4-nightly.* + + \ No newline at end of file diff --git a/src/Core/Pages/Accounts/HomePageViewModel.cs b/src/Core/Pages/Accounts/HomePageViewModel.cs index 13686ee99..193c2bd85 100644 --- a/src/Core/Pages/Accounts/HomePageViewModel.cs +++ b/src/Core/Pages/Accounts/HomePageViewModel.cs @@ -165,7 +165,7 @@ namespace Bit.App.Pages await MainThread.InvokeOnMainThreadAsync(async () => { - var result = await Page.DisplayActionSheet(AppResources.LoggingInOn, AppResources.Cancel, null, options); + var result = await _deviceActionService.Value.DisplayActionSheetAsync(AppResources.LoggingInOn, AppResources.Cancel, null, options); if (result is null || result == AppResources.Cancel) { diff --git a/src/iOS.Autofill/CredentialProviderViewController.TapGestureHack.cs b/src/iOS.Autofill/CredentialProviderViewController.TapGestureHack.cs deleted file mode 100644 index b1330ce8d..000000000 --- a/src/iOS.Autofill/CredentialProviderViewController.TapGestureHack.cs +++ /dev/null @@ -1,51 +0,0 @@ -#if ENABLED_TAP_GESTURE_RECOGNIZER_MAUI_EMBEDDED_WORKAROUND - -using System; -using AuthenticationServices; -using Bit.App.Abstractions; -using Bit.Core.Utilities; -using Bit.iOS.Autofill.Models; -using Bit.iOS.Core.Utilities; -using Microsoft.Maui.Controls; -using Microsoft.Maui.Platform; -using UIKit; - -namespace Bit.iOS.Autofill -{ - public partial class CredentialProviderViewController : ASCredentialProviderViewController, IAccountsManagerHost - { - const string STORYBOARD_NAME = "MainInterface"; - Lazy _storyboard = new Lazy(() => UIStoryboard.FromName(STORYBOARD_NAME, null)); - - public void InitWithContext(Context context) - { - _context = context; - } - - public void DismissLockAndContinue() - { - if (UIApplication.SharedApplication.KeyWindow is null) - { - return; - } - - UIApplication.SharedApplication.KeyWindow.RootViewController = _storyboard.Value.InstantiateInitialViewController(); - - if (UIApplication.SharedApplication.KeyWindow?.RootViewController is CredentialProviderViewController cpvc) - { - cpvc.InitWithContext(_context); - cpvc.OnLockDismissedAsync().FireAndForget(); - } - } - - private void NavigateToPage(ContentPage page) - { - var navigationPage = new NavigationPage(page); - - var window = new Window(navigationPage); - window.ToHandler(MauiContextSingleton.Instance.MauiContext); - } - } -} - -#endif diff --git a/src/iOS.Autofill/CredentialProviderViewController.cs b/src/iOS.Autofill/CredentialProviderViewController.cs index cafbc335c..30ff9c555 100644 --- a/src/iOS.Autofill/CredentialProviderViewController.cs +++ b/src/iOS.Autofill/CredentialProviderViewController.cs @@ -18,6 +18,8 @@ using CoreFoundation; using CoreNFC; using Foundation; using Microsoft.Maui.ApplicationModel; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Platform; using UIKit; namespace Bit.iOS.Autofill @@ -248,7 +250,6 @@ namespace Bit.iOS.Autofill } } -#if !ENABLED_TAP_GESTURE_RECOGNIZER_MAUI_EMBEDDED_WORKAROUND public async void DismissLockAndContinue() { DismissViewController(false, async () => await OnLockDismissedAsync()); @@ -262,7 +263,6 @@ namespace Bit.iOS.Autofill PresentViewController(uiController, true, null); } -#endif public async Task OnLockDismissedAsync() { diff --git a/src/iOS.Autofill/iOS.Autofill.csproj b/src/iOS.Autofill/iOS.Autofill.csproj index 5a988c2b9..458358fb6 100644 --- a/src/iOS.Autofill/iOS.Autofill.csproj +++ b/src/iOS.Autofill/iOS.Autofill.csproj @@ -10,7 +10,7 @@ False - $(DefineConstants);ENABLED_TAP_GESTURE_RECOGNIZER_MAUI_EMBEDDED_WORKAROUND + $(DefineConstants) 12.0 @@ -83,7 +83,6 @@ -