From 4f9740043b5bace134a893e7249883ba87dd093e Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 19 Jul 2016 22:38:12 -0400 Subject: [PATCH] Setup lock view controllers and storyboard --- .../LockFingerprintViewController.cs | 52 +++++++ .../LockFingerprintViewController.designer.cs | 42 ++++++ .../LockPasswordViewController.cs | 52 +++++++ .../LockPasswordViewController.designer.cs | 33 +++++ src/iOS.Extension/LockPinViewController.cs | 52 +++++++ .../LockPinViewController.designer.cs | 33 +++++ src/iOS.Extension/MainInterface.storyboard | 129 ++++++++++++++++-- src/iOS.Extension/iOS.Extension.csproj | 12 ++ 8 files changed, 397 insertions(+), 8 deletions(-) create mode 100644 src/iOS.Extension/LockFingerprintViewController.cs create mode 100644 src/iOS.Extension/LockFingerprintViewController.designer.cs create mode 100644 src/iOS.Extension/LockPasswordViewController.cs create mode 100644 src/iOS.Extension/LockPasswordViewController.designer.cs create mode 100644 src/iOS.Extension/LockPinViewController.cs create mode 100644 src/iOS.Extension/LockPinViewController.designer.cs diff --git a/src/iOS.Extension/LockFingerprintViewController.cs b/src/iOS.Extension/LockFingerprintViewController.cs new file mode 100644 index 000000000..d34b14c58 --- /dev/null +++ b/src/iOS.Extension/LockFingerprintViewController.cs @@ -0,0 +1,52 @@ +using System; +using Bit.iOS.Extension.Models; +using UIKit; +using XLabs.Ioc; +using Plugin.Settings.Abstractions; +using Foundation; +using MobileCoreServices; + +namespace Bit.iOS.Extension +{ + public partial class LockFingerprintViewController : UIViewController + { + private ISettings _settings; + + public LockFingerprintViewController(IntPtr handle) : base(handle) + { } + + public Context Context { get; set; } + + public override void ViewWillAppear(bool animated) + { + UINavigationBar.Appearance.ShadowImage = new UIImage(); + UINavigationBar.Appearance.SetBackgroundImage(new UIImage(), UIBarMetrics.Default); + base.ViewWillAppear(animated); + } + + public override void ViewDidLoad() + { + _settings = Resolver.Resolve(); + + View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f); + + var descriptor = UIFontDescriptor.PreferredBody; + + base.ViewDidLoad(); + } + + 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); + } + } +} diff --git a/src/iOS.Extension/LockFingerprintViewController.designer.cs b/src/iOS.Extension/LockFingerprintViewController.designer.cs new file mode 100644 index 000000000..2c5e36cf9 --- /dev/null +++ b/src/iOS.Extension/LockFingerprintViewController.designer.cs @@ -0,0 +1,42 @@ +// WARNING +// +// This file has been generated automatically by Xamarin 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.Extension +{ + [Register ("LockFingerprintViewController")] + partial class LockFingerprintViewController + { + [Outlet] + [GeneratedCode ("iOS Designer", "1.0")] + UIKit.UIBarButtonItem CancelButton { 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); + + void ReleaseDesignerOutlets () + { + if (CancelButton != null) { + CancelButton.Dispose (); + CancelButton = null; + } + + if (UseButton != null) { + UseButton.Dispose (); + UseButton = null; + } + } + } +} \ No newline at end of file diff --git a/src/iOS.Extension/LockPasswordViewController.cs b/src/iOS.Extension/LockPasswordViewController.cs new file mode 100644 index 000000000..0d0062099 --- /dev/null +++ b/src/iOS.Extension/LockPasswordViewController.cs @@ -0,0 +1,52 @@ +using System; +using Bit.iOS.Extension.Models; +using UIKit; +using XLabs.Ioc; +using Plugin.Settings.Abstractions; +using Foundation; +using MobileCoreServices; + +namespace Bit.iOS.Extension +{ + public partial class LockPasswordViewController : UIViewController + { + private ISettings _settings; + + public LockPasswordViewController(IntPtr handle) : base(handle) + { } + + public Context Context { get; set; } + + public override void ViewWillAppear(bool animated) + { + UINavigationBar.Appearance.ShadowImage = new UIImage(); + UINavigationBar.Appearance.SetBackgroundImage(new UIImage(), UIBarMetrics.Default); + base.ViewWillAppear(animated); + } + + public override void ViewDidLoad() + { + _settings = Resolver.Resolve(); + + View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f); + + var descriptor = UIFontDescriptor.PreferredBody; + + base.ViewDidLoad(); + } + + 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); + } + } +} diff --git a/src/iOS.Extension/LockPasswordViewController.designer.cs b/src/iOS.Extension/LockPasswordViewController.designer.cs new file mode 100644 index 000000000..72dec9309 --- /dev/null +++ b/src/iOS.Extension/LockPasswordViewController.designer.cs @@ -0,0 +1,33 @@ +// WARNING +// +// This file has been generated automatically by Xamarin 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.Extension +{ + [Register ("LockPasswordViewController")] + partial class LockPasswordViewController + { + [Outlet] + [GeneratedCode ("iOS Designer", "1.0")] + UIKit.UIBarButtonItem CancelButton { 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; + } + } + } +} \ No newline at end of file diff --git a/src/iOS.Extension/LockPinViewController.cs b/src/iOS.Extension/LockPinViewController.cs new file mode 100644 index 000000000..56e3327c2 --- /dev/null +++ b/src/iOS.Extension/LockPinViewController.cs @@ -0,0 +1,52 @@ +using System; +using Bit.iOS.Extension.Models; +using UIKit; +using XLabs.Ioc; +using Plugin.Settings.Abstractions; +using Foundation; +using MobileCoreServices; + +namespace Bit.iOS.Extension +{ + public partial class LockPinViewController : UIViewController + { + private ISettings _settings; + + public LockPinViewController(IntPtr handle) : base(handle) + { } + + public Context Context { get; set; } + + public override void ViewWillAppear(bool animated) + { + UINavigationBar.Appearance.ShadowImage = new UIImage(); + UINavigationBar.Appearance.SetBackgroundImage(new UIImage(), UIBarMetrics.Default); + base.ViewWillAppear(animated); + } + + public override void ViewDidLoad() + { + _settings = Resolver.Resolve(); + + View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f); + + var descriptor = UIFontDescriptor.PreferredBody; + + base.ViewDidLoad(); + } + + 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); + } + } +} diff --git a/src/iOS.Extension/LockPinViewController.designer.cs b/src/iOS.Extension/LockPinViewController.designer.cs new file mode 100644 index 000000000..7bc573761 --- /dev/null +++ b/src/iOS.Extension/LockPinViewController.designer.cs @@ -0,0 +1,33 @@ +// WARNING +// +// This file has been generated automatically by Xamarin 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.Extension +{ + [Register ("LockPinViewController")] + partial class LockPinViewController + { + [Outlet] + [GeneratedCode ("iOS Designer", "1.0")] + UIKit.UIBarButtonItem CancelButton { 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; + } + } + } +} \ No newline at end of file diff --git a/src/iOS.Extension/MainInterface.storyboard b/src/iOS.Extension/MainInterface.storyboard index 312a17b4f..1cfe6fe53 100644 --- a/src/iOS.Extension/MainInterface.storyboard +++ b/src/iOS.Extension/MainInterface.storyboard @@ -40,7 +40,7 @@ @@ -57,7 +57,7 @@ - + @@ -78,7 +78,7 @@ - + @@ -173,7 +173,9 @@ - + + + @@ -201,7 +203,7 @@ - + @@ -299,7 +301,7 @@ - + @@ -311,7 +313,7 @@ - + @@ -320,13 +322,124 @@ + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/iOS.Extension/iOS.Extension.csproj b/src/iOS.Extension/iOS.Extension.csproj index 505c6ffb7..be9cb07ba 100644 --- a/src/iOS.Extension/iOS.Extension.csproj +++ b/src/iOS.Extension/iOS.Extension.csproj @@ -95,6 +95,18 @@ iPhone Distribution + + + LockPasswordViewController.cs + + + + LockPinViewController.cs + + + + LockFingerprintViewController.cs + PasswordGeneratorViewController.cs