1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-17 08:43:21 +00:00

centralized complete request code into loading view controller. added support for save login provider type.

This commit is contained in:
Kyle Spearrin
2016-07-25 21:32:15 -04:00
parent b81eb007ab
commit ca23c9568d
6 changed files with 101 additions and 110 deletions

View File

@@ -4,10 +4,8 @@ using UIKit;
using XLabs.Ioc;
using Plugin.Settings.Abstractions;
using Foundation;
using MobileCoreServices;
using Bit.iOS.Core.Views;
using Bit.App.Resources;
using System.Threading.Tasks;
using Bit.iOS.Core.Utilities;
using Bit.App.Abstractions;
using System.Linq;
@@ -25,7 +23,7 @@ namespace Bit.iOS.Extension
{ }
public Context Context { get; set; }
public LoadingViewController LoadingViewController { get; set; }
public LoadingViewController LoadingController { get; set; }
public FormEntryTableViewCell MasterPasswordCell { get; set; } = new FormEntryTableViewCell(
AppResources.MasterPassword, useLabelAsPlaceholder: true);
@@ -88,7 +86,7 @@ namespace Bit.iOS.Extension
{
_settings.AddOrUpdateValue(Constants.SettingLocked, false);
MasterPasswordCell.TextField.ResignFirstResponder();
LoadingViewController.DismissLockAndContinue();
LoadingController.DismissLockAndContinue();
}
else
{
@@ -108,16 +106,7 @@ namespace Bit.iOS.Extension
partial void CancelButton_Activated(UIBarButtonItem sender)
{
CompleteRequest();
}
private void CompleteRequest()
{
var resultsProvider = new NSItemProvider(null, UTType.PropertyList);
var resultsItem = new NSExtensionItem { Attachments = new NSItemProvider[] { resultsProvider } };
var returningItems = new NSExtensionItem[] { resultsItem };
Context.ExtContext.CompleteRequest(returningItems, null);
LoadingController.CompleteRequest(null);
}
public class TableSource : UITableViewSource