diff --git a/src/iOS.Extension/ActionViewController.cs b/src/iOS.Extension/ActionViewController.cs index 228948f63..8f1597b4c 100644 --- a/src/iOS.Extension/ActionViewController.cs +++ b/src/iOS.Extension/ActionViewController.cs @@ -2,18 +2,10 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; -using Bit.App.Abstractions; -using Bit.App.Repositories; -using Bit.App.Services; -using Bit.iOS.Core.Services; -using CoreGraphics; using Foundation; -using Microsoft.Practices.Unity; using MobileCoreServices; using Newtonsoft.Json; using UIKit; -using XLabs.Ioc; -using XLabs.Ioc.Unity; namespace Bit.iOS.Extension { @@ -62,44 +54,10 @@ namespace Bit.iOS.Extension public PasswordGenerationOptions PasswordOptions { get; set; } public PageDetails Details { get; set; } - private void SetIoc() - { - var container = new UnityContainer(); - - container - // Services - .RegisterType(new ContainerControlledLifetimeManager()) - .RegisterType(new ContainerControlledLifetimeManager()) - //.RegisterType(new ContainerControlledLifetimeManager()) - .RegisterType(new ContainerControlledLifetimeManager()) - .RegisterType(new ContainerControlledLifetimeManager()) - .RegisterType(new ContainerControlledLifetimeManager()) - .RegisterType(new ContainerControlledLifetimeManager()) - .RegisterType(new ContainerControlledLifetimeManager()) - //.RegisterType(new ContainerControlledLifetimeManager()) - // Repositories - .RegisterType(new ContainerControlledLifetimeManager()) - .RegisterType(new ContainerControlledLifetimeManager()) - .RegisterType(new ContainerControlledLifetimeManager()) - .RegisterType(new ContainerControlledLifetimeManager()) - .RegisterType(new ContainerControlledLifetimeManager()); - // Other - //.RegisterInstance(CrossSettings.Current, new ContainerControlledLifetimeManager()) - //.RegisterInstance(CrossConnectivity.Current, new ContainerControlledLifetimeManager()) - //.RegisterInstance(UserDialogs.Instance, new ContainerControlledLifetimeManager()) - //.RegisterInstance(CrossFingerprint.Current, new ContainerControlledLifetimeManager()); - - Resolver.SetResolver(new UnityResolver(container)); - } - public override void ViewDidLoad() { base.ViewDidLoad(); - - if(!Resolver.IsSet) - { - SetIoc(); - } + View.BackgroundColor = UIColor.FromPatternImage(new UIImage("boxed-bg.png")); foreach(var item in ExtensionContext.InputItems) { @@ -125,8 +83,8 @@ namespace Bit.iOS.Extension } } - partial void DoneClicked(Foundation.NSObject sender) - { + partial void DoneClicked(NSObject sender) + { NSDictionary itemData = null; if(ProviderType == UTType.PropertyList) { @@ -324,7 +282,7 @@ namespace Bit.iOS.Extension return default(T); } - private T DeserializeString(NSString jsonString) + private T DeserializeString(NSString jsonString) { if(jsonString != null) { diff --git a/src/iOS.Extension/ActionViewController.designer.cs b/src/iOS.Extension/ActionViewController.designer.cs index e65d8d214..890115c59 100644 --- a/src/iOS.Extension/ActionViewController.designer.cs +++ b/src/iOS.Extension/ActionViewController.designer.cs @@ -14,19 +14,11 @@ namespace Bit.iOS.Extension [Register ("ActionViewController")] partial class ActionViewController { - [Outlet] - [GeneratedCode ("iOS Designer", "1.0")] - UIImageView logo { get; set; } - [Action ("DoneClicked:")] partial void DoneClicked (Foundation.NSObject sender); void ReleaseDesignerOutlets () { - if (logo != null) { - logo.Dispose (); - logo = null; - } } } } diff --git a/src/iOS.Extension/MainInterface.storyboard b/src/iOS.Extension/MainInterface.storyboard index 61b8bdde2..b808e165f 100644 --- a/src/iOS.Extension/MainInterface.storyboard +++ b/src/iOS.Extension/MainInterface.storyboard @@ -1,5 +1,5 @@ - + @@ -8,19 +8,19 @@ - + - + - + - + @@ -28,30 +28,94 @@ + + + - - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/iOS.Extension/Resources/boxed-bg.png b/src/iOS.Extension/Resources/boxed-bg.png new file mode 100644 index 000000000..da898fc3c Binary files /dev/null and b/src/iOS.Extension/Resources/boxed-bg.png differ diff --git a/src/iOS.Extension/Resources/logo.png b/src/iOS.Extension/Resources/logo.png new file mode 100644 index 000000000..33ced5b12 Binary files /dev/null and b/src/iOS.Extension/Resources/logo.png differ diff --git a/src/iOS.Extension/Resources/logo@2x.png b/src/iOS.Extension/Resources/logo@2x.png new file mode 100644 index 000000000..2a0ba60b9 Binary files /dev/null and b/src/iOS.Extension/Resources/logo@2x.png differ diff --git a/src/iOS.Extension/Resources/logo@3x.png b/src/iOS.Extension/Resources/logo@3x.png new file mode 100644 index 000000000..904731676 Binary files /dev/null and b/src/iOS.Extension/Resources/logo@3x.png differ diff --git a/src/iOS.Extension/SplashViewController.cs b/src/iOS.Extension/SplashViewController.cs new file mode 100644 index 000000000..6a5fee23a --- /dev/null +++ b/src/iOS.Extension/SplashViewController.cs @@ -0,0 +1,97 @@ +using System; +using System.Drawing; +using Bit.App.Abstractions; +using Bit.App.Repositories; +using Bit.App.Services; +using Bit.iOS.Core.Services; +using Foundation; +using Microsoft.Practices.Unity; +using UIKit; +using XLabs.Ioc; +using XLabs.Ioc.Unity; + +namespace Bit.iOS.Extension +{ + public partial class SplashViewController : UIViewController + { + public SplashViewController(IntPtr handle) : base(handle) + { + } + + public override void DidReceiveMemoryWarning() + { + // Releases the view if it doesn't have a superview. + base.DidReceiveMemoryWarning(); + + // Release any cached data, images, etc that aren't in use. + } + + #region View lifecycle + + public override void ViewDidLoad() + { + base.ViewDidLoad(); + View.BackgroundColor = UIColor.FromPatternImage(new UIImage("boxed-bg.png")); + NavigationController.SetNavigationBarHidden(true, false); + } + + public override void ViewWillAppear(bool animated) + { + base.ViewWillAppear(animated); + } + + public override void ViewDidAppear(bool animated) + { + base.ViewDidAppear(animated); + + if(!Resolver.IsSet) + { + SetIoc(); + } + + PerformSegue("seque", this); + } + + private void SetIoc() + { + var container = new UnityContainer(); + + container + // Services + .RegisterType(new ContainerControlledLifetimeManager()) + .RegisterType(new ContainerControlledLifetimeManager()) + //.RegisterType(new ContainerControlledLifetimeManager()) + .RegisterType(new ContainerControlledLifetimeManager()) + .RegisterType(new ContainerControlledLifetimeManager()) + .RegisterType(new ContainerControlledLifetimeManager()) + .RegisterType(new ContainerControlledLifetimeManager()) + .RegisterType(new ContainerControlledLifetimeManager()) + //.RegisterType(new ContainerControlledLifetimeManager()) + // Repositories + .RegisterType(new ContainerControlledLifetimeManager()) + .RegisterType(new ContainerControlledLifetimeManager()) + .RegisterType(new ContainerControlledLifetimeManager()) + .RegisterType(new ContainerControlledLifetimeManager()) + .RegisterType(new ContainerControlledLifetimeManager()); + // Other + //.RegisterInstance(CrossSettings.Current, new ContainerControlledLifetimeManager()) + //.RegisterInstance(CrossConnectivity.Current, new ContainerControlledLifetimeManager()) + //.RegisterInstance(UserDialogs.Instance, new ContainerControlledLifetimeManager()) + //.RegisterInstance(CrossFingerprint.Current, new ContainerControlledLifetimeManager()); + + Resolver.SetResolver(new UnityResolver(container)); + } + + public override void ViewWillDisappear(bool animated) + { + base.ViewWillDisappear(animated); + } + + public override void ViewDidDisappear(bool animated) + { + base.ViewDidDisappear(animated); + } + + #endregion + } +} \ No newline at end of file diff --git a/src/iOS.Extension/SplashViewController.designer.cs b/src/iOS.Extension/SplashViewController.designer.cs new file mode 100644 index 000000000..eb595279f --- /dev/null +++ b/src/iOS.Extension/SplashViewController.designer.cs @@ -0,0 +1,21 @@ +// 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 ("SplashViewController")] + partial class SplashViewController + { + void ReleaseDesignerOutlets () + { + } + } +} diff --git a/src/iOS.Extension/iOS.Extension.csproj b/src/iOS.Extension/iOS.Extension.csproj index 2cf9dab1d..a6d36de2b 100644 --- a/src/iOS.Extension/iOS.Extension.csproj +++ b/src/iOS.Extension/iOS.Extension.csproj @@ -95,6 +95,10 @@ + + + SplashViewController.cs + @@ -140,6 +144,10 @@ + + + +