1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-12 14:23:26 +00:00

SG-210 Account Switching in Autofill (iOS) (#1909)

* SG-210 Set up account switching on Autofill iOS

* SG-210 Fix refresh after sync on autofill ciphers, also added account switching on lock view on autofill. Also fix possible crash when scrolling when no items were displayed and also fixed navigation when login in on an automatically logged out account.

* SG-210 Added reference on iOS.Core project

* Fix formatting on AccountManager

* SG-210 Fix background color for dark theme
This commit is contained in:
Federico Maccaroni
2022-06-08 14:24:01 -03:00
committed by GitHub
parent 88b406544b
commit fba407f3b6
24 changed files with 1500 additions and 417 deletions

View File

@@ -1,10 +1,17 @@
using System;
using Bit.App.Controls;
using Bit.iOS.Core.Utilities;
using UIKit;
namespace Bit.iOS.Autofill
{
public partial class LockPasswordViewController : Core.Controllers.LockPasswordViewController
public partial class LockPasswordViewController : Core.Controllers.BaseLockPasswordViewController
{
AccountSwitchingOverlayView _accountSwitchingOverlayView;
AccountSwitchingOverlayHelper _accountSwitchingOverlayHelper;
public override UITableView TableView => MainTableView;
public LockPasswordViewController(IntPtr handle)
: base(handle)
{
@@ -20,6 +27,21 @@ namespace Bit.iOS.Autofill
public override Action Success => () => CPViewController.DismissLockAndContinue();
public override Action Cancel => () => CPViewController.CompleteRequest();
public override async void ViewDidLoad()
{
base.ViewDidLoad();
_accountSwitchingOverlayHelper = new AccountSwitchingOverlayHelper();
AccountSwitchingBarButton.Image = await _accountSwitchingOverlayHelper.CreateAvatarImageAsync();
_accountSwitchingOverlayView = _accountSwitchingOverlayHelper.CreateAccountSwitchingOverlayView(OverlayView);
}
partial void AccountSwitchingBarButton_Activated(UIBarButtonItem sender)
{
_accountSwitchingOverlayHelper.OnToolbarItemActivated(_accountSwitchingOverlayView, OverlayView);
}
partial void SubmitButton_Activated(UIBarButtonItem sender)
{
var task = CheckPasswordAsync();