mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 01:48:25 +03:00
wire up shared view controllers
This commit is contained in:
parent
d32eb9c9bc
commit
f57db917d1
15 changed files with 475 additions and 220 deletions
|
@ -12,8 +12,7 @@ using Plugin.Connectivity;
|
|||
using Plugin.Fingerprint;
|
||||
using Plugin.Settings.Abstractions;
|
||||
using SimpleInjector;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System;
|
||||
using UIKit;
|
||||
using XLabs.Ioc;
|
||||
using XLabs.Ioc.SimpleInjectorContainer;
|
||||
|
@ -69,7 +68,23 @@ namespace Bit.iOS.Autofill
|
|||
return;
|
||||
}
|
||||
|
||||
PerformSegue("loginListSegue", this);
|
||||
var lockService = Resolver.Resolve<ILockService>();
|
||||
var lockType = lockService.GetLockTypeAsync(false).GetAwaiter().GetResult();
|
||||
switch (lockType)
|
||||
{
|
||||
case App.Enums.LockType.Fingerprint:
|
||||
PerformSegue("lockFingerprintSegue", this);
|
||||
break;
|
||||
case App.Enums.LockType.PIN:
|
||||
PerformSegue("lockPinSegue", this);
|
||||
break;
|
||||
case App.Enums.LockType.Password:
|
||||
PerformSegue("lockPasswordSegue", this);
|
||||
break;
|
||||
default:
|
||||
PerformSegue("loginListSegue", this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void ProvideCredentialWithoutUserInteraction(ASPasswordCredentialIdentity credentialIdentity)
|
||||
|
@ -123,16 +138,39 @@ namespace Bit.iOS.Autofill
|
|||
public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender)
|
||||
{
|
||||
var navController = segue.DestinationViewController as UINavigationController;
|
||||
if(navController != null)
|
||||
if (navController != null)
|
||||
{
|
||||
var listLoginController = navController.TopViewController as LoginListViewController;
|
||||
var fingerprintViewController = navController.TopViewController as LockFingerprintViewController;
|
||||
var pinViewController = navController.TopViewController as LockPinViewController;
|
||||
var passwordViewController = navController.TopViewController as LockPasswordViewController;
|
||||
|
||||
if(listLoginController != null)
|
||||
if (listLoginController != null)
|
||||
{
|
||||
listLoginController.Context = _context;
|
||||
listLoginController.CPViewController = this;
|
||||
}
|
||||
else if (fingerprintViewController != null)
|
||||
{
|
||||
fingerprintViewController.CPViewController = this;
|
||||
}
|
||||
else if (pinViewController != null)
|
||||
{
|
||||
pinViewController.CPViewController = this;
|
||||
}
|
||||
else if (passwordViewController != null)
|
||||
{
|
||||
passwordViewController.CPViewController = this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void DismissLockAndContinue()
|
||||
{
|
||||
DismissViewController(false, () =>
|
||||
{
|
||||
PerformSegue("loginListSegue", this);
|
||||
});
|
||||
}
|
||||
|
||||
private void SetIoc()
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
using System;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Extension
|
||||
namespace Bit.iOS.Autofill
|
||||
{
|
||||
public partial class LockFingerprintViewController : Core.Controllers.LockFingerprintViewController
|
||||
{
|
||||
public LockFingerprintViewController(IntPtr handle) : base(handle)
|
||||
{ }
|
||||
|
||||
public LoadingViewController LoadingController { get; set; }
|
||||
public CredentialProviderViewController CPViewController { get; set; }
|
||||
public override UINavigationItem BaseNavItem => NavItem;
|
||||
public override UIBarButtonItem BaseCancelButton => CancelButton;
|
||||
public override UIButton BaseUseButton => UseButton;
|
||||
public override UIButton BaseFingerprintButton => FingerprintButton;
|
||||
public override Action Success => () => LoadingController.DismissLockAndContinue();
|
||||
public override Action Success => () => CPViewController.DismissLockAndContinue();
|
||||
|
||||
partial void CancelButton_Activated(UIBarButtonItem sender)
|
||||
{
|
||||
LoadingController.CompleteRequest(null);
|
||||
CPViewController.CompleteRequest();
|
||||
}
|
||||
|
||||
partial void FingerprintButton_TouchUpInside(UIButton sender)
|
||||
|
|
64
src/iOS.Autofill/LockFingerprintViewController.designer.cs
generated
Normal file
64
src/iOS.Autofill/LockFingerprintViewController.designer.cs
generated
Normal file
|
@ -0,0 +1,64 @@
|
|||
// WARNING
|
||||
//
|
||||
// This file has been generated automatically by Visual Studio from the outlets and
|
||||
// actions declared in your storyboard file.
|
||||
// Manual changes to this file will not be maintained.
|
||||
//
|
||||
using Foundation;
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Autofill
|
||||
{
|
||||
[Register ("LockFingerprintViewController")]
|
||||
partial class LockFingerprintViewController
|
||||
{
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UIBarButtonItem CancelButton { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UIButton FingerprintButton { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UINavigationItem NavItem { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UIButton UseButton { get; set; }
|
||||
|
||||
[Action ("CancelButton_Activated:")]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
partial void CancelButton_Activated (UIKit.UIBarButtonItem sender);
|
||||
|
||||
[Action ("FingerprintButton_TouchUpInside:")]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
partial void FingerprintButton_TouchUpInside (UIKit.UIButton sender);
|
||||
|
||||
void ReleaseDesignerOutlets ()
|
||||
{
|
||||
if (CancelButton != null) {
|
||||
CancelButton.Dispose ();
|
||||
CancelButton = null;
|
||||
}
|
||||
|
||||
if (FingerprintButton != null) {
|
||||
FingerprintButton.Dispose ();
|
||||
FingerprintButton = null;
|
||||
}
|
||||
|
||||
if (NavItem != null) {
|
||||
NavItem.Dispose ();
|
||||
NavItem = null;
|
||||
}
|
||||
|
||||
if (UseButton != null) {
|
||||
UseButton.Dispose ();
|
||||
UseButton = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,18 +1,18 @@
|
|||
using System;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Extension
|
||||
namespace Bit.iOS.Autofill
|
||||
{
|
||||
public partial class LockPasswordViewController : Core.Controllers.LockPasswordViewController
|
||||
{
|
||||
public LockPasswordViewController(IntPtr handle) : base(handle)
|
||||
{ }
|
||||
|
||||
public LoadingViewController LoadingController { get; set; }
|
||||
public CredentialProviderViewController CPViewController { get; set; }
|
||||
public override UINavigationItem BaseNavItem => NavItem;
|
||||
public override UIBarButtonItem BaseCancelButton => CancelButton;
|
||||
public override UIBarButtonItem BaseSubmitButton => SubmitButton;
|
||||
public override Action Success => () => LoadingController.DismissLockAndContinue();
|
||||
public override Action Success => () => CPViewController.DismissLockAndContinue();
|
||||
|
||||
partial void SubmitButton_Activated(UIBarButtonItem sender)
|
||||
{
|
||||
|
@ -21,7 +21,7 @@ namespace Bit.iOS.Extension
|
|||
|
||||
partial void CancelButton_Activated(UIBarButtonItem sender)
|
||||
{
|
||||
LoadingController.CompleteRequest(null);
|
||||
CPViewController.CompleteRequest();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
64
src/iOS.Autofill/LockPasswordViewController.designer.cs
generated
Normal file
64
src/iOS.Autofill/LockPasswordViewController.designer.cs
generated
Normal file
|
@ -0,0 +1,64 @@
|
|||
// WARNING
|
||||
//
|
||||
// This file has been generated automatically by Visual Studio from the outlets and
|
||||
// actions declared in your storyboard file.
|
||||
// Manual changes to this file will not be maintained.
|
||||
//
|
||||
using Foundation;
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Autofill
|
||||
{
|
||||
[Register ("LockPasswordViewController")]
|
||||
partial class LockPasswordViewController
|
||||
{
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UIBarButtonItem CancelButton { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UITableView MainTableView { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UINavigationItem NavItem { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UIBarButtonItem SubmitButton { get; set; }
|
||||
|
||||
[Action ("CancelButton_Activated:")]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
partial void CancelButton_Activated (UIKit.UIBarButtonItem sender);
|
||||
|
||||
[Action ("SubmitButton_Activated:")]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
partial void SubmitButton_Activated (UIKit.UIBarButtonItem sender);
|
||||
|
||||
void ReleaseDesignerOutlets ()
|
||||
{
|
||||
if (CancelButton != null) {
|
||||
CancelButton.Dispose ();
|
||||
CancelButton = null;
|
||||
}
|
||||
|
||||
if (MainTableView != null) {
|
||||
MainTableView.Dispose ();
|
||||
MainTableView = null;
|
||||
}
|
||||
|
||||
if (NavItem != null) {
|
||||
NavItem.Dispose ();
|
||||
NavItem = null;
|
||||
}
|
||||
|
||||
if (SubmitButton != null) {
|
||||
SubmitButton.Dispose ();
|
||||
SubmitButton = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,24 +1,24 @@
|
|||
using System;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Extension
|
||||
namespace Bit.iOS.Autofill
|
||||
{
|
||||
public partial class LockPinViewController : Core.Controllers.LockPinViewController
|
||||
{
|
||||
public LockPinViewController(IntPtr handle) : base(handle)
|
||||
{ }
|
||||
|
||||
public LoadingViewController LoadingController { get; set; }
|
||||
public CredentialProviderViewController CPViewController { get; set; }
|
||||
public override UINavigationItem BaseNavItem => NavItem;
|
||||
public override UIBarButtonItem BaseCancelButton => CancelButton;
|
||||
public override UILabel BasePinLabel => PinLabel;
|
||||
public override UILabel BaseInstructionLabel => InstructionLabel;
|
||||
public override UITextField BasePinTextField => PinTextField;
|
||||
public override Action Success => () => LoadingController.DismissLockAndContinue();
|
||||
public override Action Success => () => CPViewController.DismissLockAndContinue();
|
||||
|
||||
partial void CancelButton_Activated(UIBarButtonItem sender)
|
||||
{
|
||||
LoadingController.CompleteRequest(null);
|
||||
CPViewController.CompleteRequest();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
69
src/iOS.Autofill/LockPinViewController.designer.cs
generated
Normal file
69
src/iOS.Autofill/LockPinViewController.designer.cs
generated
Normal file
|
@ -0,0 +1,69 @@
|
|||
// WARNING
|
||||
//
|
||||
// This file has been generated automatically by Visual Studio from the outlets and
|
||||
// actions declared in your storyboard file.
|
||||
// Manual changes to this file will not be maintained.
|
||||
//
|
||||
using Foundation;
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Autofill
|
||||
{
|
||||
[Register ("LockPinViewController")]
|
||||
partial class LockPinViewController
|
||||
{
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UIBarButtonItem CancelButton { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UILabel InstructionLabel { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UINavigationItem NavItem { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UILabel PinLabel { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UITextField PinTextField { get; set; }
|
||||
|
||||
[Action ("CancelButton_Activated:")]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
partial void CancelButton_Activated (UIKit.UIBarButtonItem sender);
|
||||
|
||||
void ReleaseDesignerOutlets ()
|
||||
{
|
||||
if (CancelButton != null) {
|
||||
CancelButton.Dispose ();
|
||||
CancelButton = null;
|
||||
}
|
||||
|
||||
if (InstructionLabel != null) {
|
||||
InstructionLabel.Dispose ();
|
||||
InstructionLabel = null;
|
||||
}
|
||||
|
||||
if (NavItem != null) {
|
||||
NavItem.Dispose ();
|
||||
NavItem = null;
|
||||
}
|
||||
|
||||
if (PinLabel != null) {
|
||||
PinLabel.Dispose ();
|
||||
PinLabel = null;
|
||||
}
|
||||
|
||||
if (PinTextField != null) {
|
||||
PinTextField.Dispose ();
|
||||
PinTextField = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@ using System;
|
|||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Extension
|
||||
namespace Bit.iOS.Autofill
|
||||
{
|
||||
public partial class LoginAddViewController : Core.Controllers.LoginAddViewController
|
||||
{
|
||||
|
@ -10,7 +10,6 @@ namespace Bit.iOS.Extension
|
|||
{ }
|
||||
|
||||
public LoginListViewController LoginListController { get; set; }
|
||||
public LoadingViewController LoadingController { get; set; }
|
||||
|
||||
public override UINavigationItem BaseNavItem => NavItem;
|
||||
public override UIBarButtonItem BaseCancelButton => CancelBarButton;
|
||||
|
@ -18,27 +17,12 @@ namespace Bit.iOS.Extension
|
|||
|
||||
public override Action Success => () =>
|
||||
{
|
||||
if(LoginListController != null)
|
||||
{
|
||||
LoginListController.DismissModal();
|
||||
}
|
||||
else if(LoadingController != null)
|
||||
{
|
||||
LoadingController.CompleteUsernamePasswordRequest(UsernameCell.TextField.Text,
|
||||
PasswordCell.TextField.Text, null, null);
|
||||
}
|
||||
LoginListController?.DismissModal();
|
||||
};
|
||||
|
||||
partial void CancelBarButton_Activated(UIBarButtonItem sender)
|
||||
{
|
||||
if(LoginListController != null)
|
||||
{
|
||||
DismissViewController(true, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadingController.CompleteRequest(null);
|
||||
}
|
||||
DismissViewController(true, null);
|
||||
}
|
||||
|
||||
async partial void SaveBarButton_Activated(UIBarButtonItem sender)
|
||||
|
|
55
src/iOS.Autofill/LoginAddViewController.designer.cs
generated
Normal file
55
src/iOS.Autofill/LoginAddViewController.designer.cs
generated
Normal file
|
@ -0,0 +1,55 @@
|
|||
// WARNING
|
||||
//
|
||||
// This file has been generated automatically by Visual Studio from the outlets and
|
||||
// actions declared in your storyboard file.
|
||||
// Manual changes to this file will not be maintained.
|
||||
//
|
||||
using Foundation;
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Autofill
|
||||
{
|
||||
[Register ("LoginAddViewController")]
|
||||
partial class LoginAddViewController
|
||||
{
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UIBarButtonItem CancelBarButton { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UINavigationItem NavItem { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UIBarButtonItem SaveBarButton { get; set; }
|
||||
|
||||
[Action ("CancelBarButton_Activated:")]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
partial void CancelBarButton_Activated (UIKit.UIBarButtonItem sender);
|
||||
|
||||
[Action ("SaveBarButton_Activated:")]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
partial void SaveBarButton_Activated (UIKit.UIBarButtonItem sender);
|
||||
|
||||
void ReleaseDesignerOutlets ()
|
||||
{
|
||||
if (CancelBarButton != null) {
|
||||
CancelBarButton.Dispose ();
|
||||
CancelBarButton = null;
|
||||
}
|
||||
|
||||
if (NavItem != null) {
|
||||
NavItem.Dispose ();
|
||||
NavItem = null;
|
||||
}
|
||||
|
||||
if (SaveBarButton != null) {
|
||||
SaveBarButton.Dispose ();
|
||||
SaveBarButton = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -17,6 +17,7 @@ using Bit.App.Resources;
|
|||
using Bit.App.Models;
|
||||
using Bit.App.Utilities;
|
||||
using Bit.iOS.Core.Models;
|
||||
using Bit.iOS.Core.Views;
|
||||
|
||||
namespace Bit.iOS.Autofill
|
||||
{
|
||||
|
@ -62,14 +63,12 @@ namespace Bit.iOS.Autofill
|
|||
var navController = segue.DestinationViewController as UINavigationController;
|
||||
if(navController != null)
|
||||
{
|
||||
/*
|
||||
var addLoginController = navController.TopViewController as LoginAddViewController;
|
||||
if(addLoginController != null)
|
||||
{
|
||||
addLoginController.Context = Context;
|
||||
addLoginController.LoginListController = this;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,87 +81,16 @@ namespace Bit.iOS.Autofill
|
|||
});
|
||||
}
|
||||
|
||||
public class TableSource : UITableViewSource
|
||||
public class TableSource : ExtensionTableSource
|
||||
{
|
||||
private const string CellIdentifier = "TableCell";
|
||||
|
||||
private IEnumerable<CipherViewModel> _tableItems = new List<CipherViewModel>();
|
||||
private Context _context;
|
||||
private LoginListViewController _controller;
|
||||
private ICipherService _cipherService;
|
||||
private ISettings _settings;
|
||||
private bool _accessPremium;
|
||||
|
||||
public TableSource(LoginListViewController controller)
|
||||
:base(controller.Context, controller)
|
||||
{
|
||||
_context = controller.Context;
|
||||
_controller = controller;
|
||||
_accessPremium = Helpers.CanAccessPremium();
|
||||
_cipherService = Resolver.Resolve<ICipherService>();
|
||||
_settings = Resolver.Resolve<ISettings>();
|
||||
}
|
||||
|
||||
public async Task LoadItemsAsync()
|
||||
{
|
||||
var combinedLogins = new List<Cipher>();
|
||||
|
||||
var logins = await _cipherService.GetAllAsync(_context.UrlString);
|
||||
if(logins?.Item1 != null)
|
||||
{
|
||||
combinedLogins.AddRange(logins.Item1);
|
||||
}
|
||||
if(logins?.Item2 != null)
|
||||
{
|
||||
combinedLogins.AddRange(logins.Item2);
|
||||
}
|
||||
|
||||
_tableItems = combinedLogins.Select(s => new CipherViewModel(s))
|
||||
.OrderBy(s => s.Name)
|
||||
.ThenBy(s => s.Username)
|
||||
.ToList() ?? new List<CipherViewModel>();
|
||||
}
|
||||
|
||||
public IEnumerable<CipherViewModel> TableItems { get; set; }
|
||||
|
||||
public override nint RowsInSection(UITableView tableview, nint section)
|
||||
{
|
||||
return _tableItems == null || _tableItems.Count() == 0 ? 1 : _tableItems.Count();
|
||||
}
|
||||
|
||||
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
|
||||
{
|
||||
if(_tableItems == null || _tableItems.Count() == 0)
|
||||
{
|
||||
var noDataCell = new UITableViewCell(UITableViewCellStyle.Default, "NoDataCell");
|
||||
noDataCell.TextLabel.Text = AppResources.NoItemsTap;
|
||||
noDataCell.TextLabel.TextAlignment = UITextAlignment.Center;
|
||||
noDataCell.TextLabel.LineBreakMode = UILineBreakMode.WordWrap;
|
||||
noDataCell.TextLabel.Lines = 0;
|
||||
return noDataCell;
|
||||
}
|
||||
|
||||
var cell = tableView.DequeueReusableCell(CellIdentifier);
|
||||
|
||||
// if there are no cells to reuse, create a new one
|
||||
if(cell == null)
|
||||
{
|
||||
Debug.WriteLine("BW Log, Make new cell for list.");
|
||||
cell = new UITableViewCell(UITableViewCellStyle.Subtitle, CellIdentifier);
|
||||
cell.DetailTextLabel.TextColor = cell.DetailTextLabel.TintColor = new UIColor(red: 0.47f, green: 0.47f, blue: 0.47f, alpha: 1.0f);
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
|
||||
public override void WillDisplay(UITableView tableView, UITableViewCell cell, NSIndexPath indexPath)
|
||||
{
|
||||
if(_tableItems == null || _tableItems.Count() == 0 || cell == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var item = _tableItems.ElementAt(indexPath.Row);
|
||||
cell.TextLabel.Text = item.Name;
|
||||
cell.DetailTextLabel.Text = item.Username;
|
||||
}
|
||||
|
||||
public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
|
||||
|
@ -254,20 +182,6 @@ namespace Bit.iOS.Autofill
|
|||
_controller.PresentViewController(alert, true, null);
|
||||
}
|
||||
}
|
||||
|
||||
private string GetTotp(CipherViewModel item)
|
||||
{
|
||||
string totp = null;
|
||||
if(_accessPremium)
|
||||
{
|
||||
if(item != null && !string.IsNullOrWhiteSpace(item.Totp.Value))
|
||||
{
|
||||
totp = Crypto.Totp(item.Totp.Value);
|
||||
}
|
||||
}
|
||||
|
||||
return totp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
55
src/iOS.Autofill/LoginListViewController.designer.cs
generated
Normal file
55
src/iOS.Autofill/LoginListViewController.designer.cs
generated
Normal file
|
@ -0,0 +1,55 @@
|
|||
// WARNING
|
||||
//
|
||||
// This file has been generated automatically by Visual Studio from the outlets and
|
||||
// actions declared in your storyboard file.
|
||||
// Manual changes to this file will not be maintained.
|
||||
//
|
||||
using Foundation;
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Autofill
|
||||
{
|
||||
[Register ("LoginListViewController")]
|
||||
partial class LoginListViewController
|
||||
{
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UIBarButtonItem AddBarButton { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UIBarButtonItem CancelBarButton { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UINavigationItem NavItem { get; set; }
|
||||
|
||||
[Action ("AddBarButton_Activated:")]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
partial void AddBarButton_Activated (UIKit.UIBarButtonItem sender);
|
||||
|
||||
[Action ("CancelBarButton_Activated:")]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
partial void CancelBarButton_Activated (UIKit.UIBarButtonItem sender);
|
||||
|
||||
void ReleaseDesignerOutlets ()
|
||||
{
|
||||
if (AddBarButton != null) {
|
||||
AddBarButton.Dispose ();
|
||||
AddBarButton = null;
|
||||
}
|
||||
|
||||
if (CancelBarButton != null) {
|
||||
CancelBarButton.Dispose ();
|
||||
CancelBarButton = null;
|
||||
}
|
||||
|
||||
if (NavItem != null) {
|
||||
NavItem.Dispose ();
|
||||
NavItem = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -33,7 +33,6 @@
|
|||
<segue destination="6815" kind="presentation" identifier="lockPinSegue" id="8924"/>
|
||||
<segue destination="6855" kind="presentation" identifier="lockPasswordSegue" id="9874"/>
|
||||
<segue destination="1845" kind="presentation" identifier="newLoginSegue" modalPresentationStyle="fullScreen" modalTransitionStyle="coverVertical" id="10498"/>
|
||||
<segue destination="10580" kind="presentation" identifier="setupSegue" modalTransitionStyle="coverVertical" id="11089"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="45" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
|
@ -521,89 +520,7 @@
|
|||
<point key="canvasLocation" x="977" y="2775"/>
|
||||
</scene>
|
||||
<!--Setup View Controller-->
|
||||
<scene sceneID="10573">
|
||||
<objects>
|
||||
<viewController id="10570" customClass="SetupViewController" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="10565"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="10566"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="10575">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Extension Activated!" textAlignment="center" lineBreakMode="tailTruncation" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="11092">
|
||||
<rect key="frame" x="15" y="100" width="384" height="20.5"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" misplaced="YES" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="0" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="11093">
|
||||
<rect key="frame" x="15" y="134.5" width="570" height="41"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" misplaced="YES" image="ext-icon.png" translatesAutoresizingMaskIntoConstraints="NO" id="11094">
|
||||
<rect key="frame" x="255" y="205.5" width="90" height="90"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="11092" firstAttribute="leading" secondItem="10575" secondAttribute="leading" constant="15" id="11114"/>
|
||||
<constraint firstAttribute="trailing" secondItem="11092" secondAttribute="trailing" constant="15" id="11115"/>
|
||||
<constraint firstItem="11092" firstAttribute="top" secondItem="10565" secondAttribute="bottom" constant="30" id="11116"/>
|
||||
<constraint firstItem="11093" firstAttribute="leading" secondItem="10575" secondAttribute="leading" constant="15" id="11119"/>
|
||||
<constraint firstAttribute="trailing" secondItem="11093" secondAttribute="trailing" constant="15" id="11120"/>
|
||||
<constraint firstItem="11093" firstAttribute="top" secondItem="11092" secondAttribute="bottom" constant="20" id="11121"/>
|
||||
<constraint firstItem="11094" firstAttribute="centerX" secondItem="10575" secondAttribute="centerX" id="11122"/>
|
||||
<constraint firstItem="11094" firstAttribute="top" secondItem="11093" secondAttribute="bottom" constant="30" id="11123"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<navigationItem key="navigationItem" id="10574">
|
||||
<barButtonItem key="leftBarButtonItem" title="Back" id="11091">
|
||||
<connections>
|
||||
<action selector="BackButton_Activated:" destination="10570" id="11124"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
</navigationItem>
|
||||
<connections>
|
||||
<outlet property="ActivatedLabel" destination="11092" id="name-outlet-11092"/>
|
||||
<outlet property="BackButton" destination="11091" id="name-outlet-11091"/>
|
||||
<outlet property="DescriptionLabel" destination="11093" id="name-outlet-11093"/>
|
||||
<outlet property="IconImage" destination="11094" id="name-outlet-11094"/>
|
||||
<outlet property="NavItem" destination="10574" id="name-outlet-10574"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="10576" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1129" y="-264"/>
|
||||
</scene>
|
||||
<!--Navigation Controller-->
|
||||
<scene sceneID="10579">
|
||||
<objects>
|
||||
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="10580" sceneMemberID="viewController">
|
||||
<toolbarItems/>
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="10583">
|
||||
<rect key="frame" x="0.0" y="20" width="414" height="50"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<color key="barTintColor" red="0.23529411764705882" green="0.55294117647058827" blue="0.73725490196078436" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<textAttributes key="titleTextAttributes">
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</textAttributes>
|
||||
</navigationBar>
|
||||
<nil name="viewControllers"/>
|
||||
<connections>
|
||||
<segue destination="10570" kind="relationship" relationship="rootViewController" id="10939"/>
|
||||
</connections>
|
||||
</navigationController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="10584" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="362" y="-267"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="fingerprint.png" width="91" height="92"/>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Extension
|
||||
namespace Bit.iOS.Autofill
|
||||
{
|
||||
public partial class PasswordGeneratorViewController : Core.Controllers.PasswordGeneratorViewController
|
||||
{
|
||||
|
@ -16,7 +16,7 @@ namespace Bit.iOS.Extension
|
|||
|
||||
partial void SelectBarButton_Activated(UIBarButtonItem sender)
|
||||
{
|
||||
GoogleAnalyticsService.TrackExtensionEvent("SelectedGeneratedPassword");
|
||||
GoogleAnalyticsService.TrackAutofillExtensionEvent("SelectedGeneratedPassword");
|
||||
DismissViewController(true, () =>
|
||||
{
|
||||
Parent.PasswordCell.TextField.Text = PasswordLabel.Text;
|
||||
|
|
82
src/iOS.Autofill/PasswordGeneratorViewController.designer.cs
generated
Normal file
82
src/iOS.Autofill/PasswordGeneratorViewController.designer.cs
generated
Normal file
|
@ -0,0 +1,82 @@
|
|||
// WARNING
|
||||
//
|
||||
// This file has been generated automatically by Visual Studio from the outlets and
|
||||
// actions declared in your storyboard file.
|
||||
// Manual changes to this file will not be maintained.
|
||||
//
|
||||
using Foundation;
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Autofill
|
||||
{
|
||||
[Register ("PasswordGeneratorViewController")]
|
||||
partial class PasswordGeneratorViewController
|
||||
{
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UIView BaseView { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UIBarButtonItem CancelBarButton { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UINavigationItem NavItem { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UIView OptionsContainer { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UILabel PasswordLabel { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UIBarButtonItem SelectBarButton { get; set; }
|
||||
|
||||
[Action ("CancelBarButton_Activated:")]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
partial void CancelBarButton_Activated (UIKit.UIBarButtonItem sender);
|
||||
|
||||
[Action ("SelectBarButton_Activated:")]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
partial void SelectBarButton_Activated (UIKit.UIBarButtonItem sender);
|
||||
|
||||
void ReleaseDesignerOutlets ()
|
||||
{
|
||||
if (BaseView != null) {
|
||||
BaseView.Dispose ();
|
||||
BaseView = null;
|
||||
}
|
||||
|
||||
if (CancelBarButton != null) {
|
||||
CancelBarButton.Dispose ();
|
||||
CancelBarButton = null;
|
||||
}
|
||||
|
||||
if (NavItem != null) {
|
||||
NavItem.Dispose ();
|
||||
NavItem = null;
|
||||
}
|
||||
|
||||
if (OptionsContainer != null) {
|
||||
OptionsContainer.Dispose ();
|
||||
OptionsContainer = null;
|
||||
}
|
||||
|
||||
if (PasswordLabel != null) {
|
||||
PasswordLabel.Dispose ();
|
||||
PasswordLabel = null;
|
||||
}
|
||||
|
||||
if (SelectBarButton != null) {
|
||||
SelectBarButton.Dispose ();
|
||||
SelectBarButton = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
||||
|
@ -10,8 +9,7 @@
|
|||
<AssemblyName>BitwardeniOSAutofill</AssemblyName>
|
||||
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
<NuGetPackageImportStamp></NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -74,10 +72,8 @@
|
|||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchDebug>True</MtouchDebug>
|
||||
<CodesignProvision>
|
||||
</CodesignProvision>
|
||||
<CodesignExtraArgs>
|
||||
</CodesignExtraArgs>
|
||||
<CodesignProvision></CodesignProvision>
|
||||
<CodesignExtraArgs></CodesignExtraArgs>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchProfiling>False</MtouchProfiling>
|
||||
<MtouchFastDev>False</MtouchFastDev>
|
||||
|
@ -88,8 +84,7 @@
|
|||
<MtouchFloat32>False</MtouchFloat32>
|
||||
<DeviceSpecificBuild>False</DeviceSpecificBuild>
|
||||
<MtouchExtraArgs>--http-message-handler=NSUrlSessionHandler</MtouchExtraArgs>
|
||||
<MtouchSdkVersion>
|
||||
</MtouchSdkVersion>
|
||||
<MtouchSdkVersion></MtouchSdkVersion>
|
||||
<MtouchTlsProvider>Default</MtouchTlsProvider>
|
||||
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
|
||||
</PropertyGroup>
|
||||
|
@ -220,6 +215,24 @@
|
|||
<DependentUpon>CredentialProviderViewController.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LoginListViewController.cs" />
|
||||
<Compile Include="LockFingerprintViewController.designer.cs">
|
||||
<DependentUpon>..\iOS.Extension\LockFingerprintViewController.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LockPasswordViewController.designer.cs">
|
||||
<DependentUpon>..\iOS.Extension\LockPasswordViewController.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LockPinViewController.designer.cs">
|
||||
<DependentUpon>..\iOS.Extension\LockPinViewController.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LoginAddViewController.designer.cs">
|
||||
<DependentUpon>..\iOS.Extension\LoginAddViewController.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LoginListViewController.designer.cs">
|
||||
<DependentUpon>..\iOS.Extension\LoginListViewController.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PasswordGeneratorViewController.designer.cs">
|
||||
<DependentUpon>..\iOS.Extension\PasswordGeneratorViewController.cs</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
|
Loading…
Reference in a new issue