mirror of
https://github.com/bitwarden/mobile
synced 2026-01-02 00:23:15 +00:00
PM-3350 Fix iOS extensions navigation and Window/RootViewController handling for TapGestureRecognizer to work
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#if ENABLED_TAP_GESTURE_RECOGNIZER_MAUI_EMBEDDED_WORKAROUND
|
||||
|
||||
using Bit.iOS.Core.Utilities;
|
||||
using Microsoft.Maui.Controls;
|
||||
using Microsoft.Maui.Platform;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.ShareExtension
|
||||
{
|
||||
public partial class LoadingViewController : UIViewController
|
||||
{
|
||||
private void NavigateToPage(ContentPage page)
|
||||
{
|
||||
var navigationPage = new NavigationPage(page);
|
||||
|
||||
var window = new Window(navigationPage);
|
||||
window.ToHandler(MauiContextSingleton.Instance.MauiContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -137,6 +137,23 @@ namespace Bit.iOS.ShareExtension
|
||||
}
|
||||
}
|
||||
|
||||
#if !ENABLED_TAP_GESTURE_RECOGNIZER_MAUI_EMBEDDED_WORKAROUND
|
||||
|
||||
private void NavigateToPage(ContentPage page)
|
||||
{
|
||||
var navigationPage = new NavigationPage(page);
|
||||
|
||||
var window = new Window(navigationPage);
|
||||
window.ToHandler(MauiContextSingleton.Instance.MauiContext);
|
||||
|
||||
_currentModalController = navigationPage.ToUIViewController(MauiContextSingleton.Instance.MauiContext);
|
||||
_currentModalController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
|
||||
_presentingOnNavigationPage = true;
|
||||
PresentViewController(_currentModalController, true, null);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
public void DismissLockAndContinue()
|
||||
{
|
||||
Debug.WriteLine("BW Log, Dismissing lock controller.");
|
||||
@@ -197,19 +214,6 @@ namespace Bit.iOS.ShareExtension
|
||||
NavigateToPage(sendPage);
|
||||
}
|
||||
|
||||
private void NavigateToPage(ContentPage page)
|
||||
{
|
||||
var navigationPage = new NavigationPage(page);
|
||||
|
||||
var window = new Window(navigationPage);
|
||||
window.ToHandler(MauiContextSingleton.Instance.MauiContext);
|
||||
|
||||
_currentModalController = navigationPage.ToUIViewController(MauiContextSingleton.Instance.MauiContext);
|
||||
_currentModalController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
|
||||
_presentingOnNavigationPage = true;
|
||||
PresentViewController(_currentModalController, true, null);
|
||||
}
|
||||
|
||||
private async Task<(string, byte[])> LoadDataBytesAsync()
|
||||
{
|
||||
var itemProvider = ExtensionContext?.InputItems.FirstOrDefault()?.Attachments?.FirstOrDefault();
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
<ApplicationVersion>1</ApplicationVersion>
|
||||
|
||||
<EnableDefaultCompileItems>False</EnableDefaultCompileItems>
|
||||
|
||||
<DefineConstants>$(DefineConstants);ENABLED_TAP_GESTURE_RECOGNIZER_MAUI_EMBEDDED_WORKAROUND</DefineConstants>
|
||||
|
||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
|
||||
<RootNamespace>Bit.iOS.ShareExtension</RootNamespace>
|
||||
@@ -62,6 +64,7 @@
|
||||
<Compile Include="ExtensionNavigationController.designer.cs">
|
||||
<DependentUpon>ExtensionNavigationController.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LoadingViewController.TapGestureHack.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="..\iOS\Resources\logo_white%403x.png">
|
||||
|
||||
Reference in New Issue
Block a user