From 186bbddff6d9df182453a7c6d9a239fcf2e13b75 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 2 Jun 2016 23:28:17 -0400 Subject: [PATCH] added storyboard to extension --- src/iOS.Extension/ActionViewController.cs | 39 ++---------- .../ActionViewController.designer.cs | 13 +++- src/iOS.Extension/ActionViewController.xib | 18 ------ src/iOS.Extension/Info.plist | 4 +- src/iOS.Extension/MainInterface.storyboard | 63 +++++++++++++++++++ src/iOS.Extension/iOS.Extension.csproj | 2 +- 6 files changed, 81 insertions(+), 58 deletions(-) delete mode 100644 src/iOS.Extension/ActionViewController.xib create mode 100644 src/iOS.Extension/MainInterface.storyboard diff --git a/src/iOS.Extension/ActionViewController.cs b/src/iOS.Extension/ActionViewController.cs index 65f47eb6d..71bd472f5 100644 --- a/src/iOS.Extension/ActionViewController.cs +++ b/src/iOS.Extension/ActionViewController.cs @@ -48,9 +48,7 @@ namespace Bit.iOS.Extension private const string UTTypeAppExtensionFillWebViewAction = "org.appextension.fill-webview-action"; private const string UTTypeAppExtensionFillBrowserAction = "org.appextension.fill-browser-action"; - private UIImageView _splashImageView; - - public ActionViewController() : base("ActionViewController", null) + public ActionViewController(IntPtr handle) : base(handle) { } @@ -94,21 +92,9 @@ namespace Bit.iOS.Extension Resolver.SetResolver(new UnityResolver(container)); } - public override void LoadView() + public override void ViewDidLoad() { - View = new UIView(UIScreen.MainScreen.Bounds) - { - BackgroundColor = new UIColor(0.93f, 0.94f, 0.96f, 1.0f), - }; - - _splashImageView = new UIImageView(new UIImage("Icon.png")); - - View.AddSubview(_splashImageView); - } - - public override void ViewDidAppear(bool animated) - { - base.ViewDidAppear(animated); + base.ViewDidLoad(); if(!Resolver.IsSet) { @@ -137,26 +123,9 @@ namespace Bit.iOS.Extension break; } } - - var navBar = new UINavigationBar(new CGRect(0, 0, View.Frame.Size.Width, 44)) - { - BackgroundColor = new UIColor(0.24f, 0.55f, 0.74f, 1.0f), - TintColor = UIColor.White - }; - - var button = new UIButton(new CGRect(x: 10.0, y: 50.0, width: View.Frame.Size.Width - 100, height: 30.0)) - { - BackgroundColor = UIColor.Black, - TintColor = UIColor.White - }; - button.SetTitle("Done", UIControlState.Normal); - button.TouchUpInside += Button_TouchUpInside; - - _splashImageView.RemoveFromSuperview(); - View.AddSubviews(navBar, button); } - private void Button_TouchUpInside(object sender, EventArgs e) + partial void DoneClicked(NSObject sender) { NSDictionary itemData = null; if(ProviderType == UTType.PropertyList) diff --git a/src/iOS.Extension/ActionViewController.designer.cs b/src/iOS.Extension/ActionViewController.designer.cs index 6d132dfe9..4925b123f 100644 --- a/src/iOS.Extension/ActionViewController.designer.cs +++ b/src/iOS.Extension/ActionViewController.designer.cs @@ -1,18 +1,27 @@ // WARNING // -// This file has been generated automatically by Visual Studio from the outlets and +// 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("ActionViewController")] partial class ActionViewController { + [Outlet] + UIImageView imageView { get; set; } + + [Action("DoneClicked:")] + partial void DoneClicked(NSObject sender); + void ReleaseDesignerOutlets() { } } -} \ No newline at end of file +} diff --git a/src/iOS.Extension/ActionViewController.xib b/src/iOS.Extension/ActionViewController.xib deleted file mode 100644 index cd6490b78..000000000 --- a/src/iOS.Extension/ActionViewController.xib +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/iOS.Extension/Info.plist b/src/iOS.Extension/Info.plist index b07c9fd51..fc958866e 100644 --- a/src/iOS.Extension/Info.plist +++ b/src/iOS.Extension/Info.plist @@ -48,8 +48,8 @@ NSExtensionPointVersion 1.0 - NSExtensionPrincipalClass - ActionViewController + NSExtensionMainStoryboard + MainInterface NSExtensionPointIdentifier com.apple.ui-services diff --git a/src/iOS.Extension/MainInterface.storyboard b/src/iOS.Extension/MainInterface.storyboard new file mode 100644 index 000000000..76eede89d --- /dev/null +++ b/src/iOS.Extension/MainInterface.storyboard @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/iOS.Extension/iOS.Extension.csproj b/src/iOS.Extension/iOS.Extension.csproj index 6f9585e25..2cf9dab1d 100644 --- a/src/iOS.Extension/iOS.Extension.csproj +++ b/src/iOS.Extension/iOS.Extension.csproj @@ -95,10 +95,10 @@ - + Designer