added storyboard to extension

This commit is contained in:
Kyle Spearrin 2016-06-02 23:28:17 -04:00
parent 437b565f8e
commit 186bbddff6
6 changed files with 81 additions and 58 deletions

View file

@ -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)

View file

@ -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()
{
}
}
}
}

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703" />
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ActionViewController">
<connections>
<outlet property="view" destination="2" id="RRd-Eg-VrN" />
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder" />
<view contentMode="scaleToFill" id="2">
<rect key="frame" x="0.0" y="0.0" width="600" height="600" />
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite" />
</view>
</objects>
</document>

View file

@ -48,8 +48,8 @@
<key>NSExtensionPointVersion</key>
<string>1.0</string>
</dict>
<key>NSExtensionPrincipalClass</key>
<string>ActionViewController</string>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.ui-services</string>
</dict>

View file

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6154.17" systemVersion="13D65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="ObA-dk-sSI">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6153.11"/>
</dependencies>
<scenes>
<!--Action View Controller - Image-->
<scene sceneID="7MM-of-jgj">
<objects>
<viewController title="Image" id="ObA-dk-sSI" customClass="ActionViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="qkL-Od-lgU"/>
<viewControllerLayoutGuide type="bottom" id="n38-gi-rB5"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="zMn-AG-sqS">
<rect key="frame" x="0.0" y="0.0" width="320" height="528"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="9ga-4F-77Z">
<rect key="frame" x="0.0" y="64" width="320" height="464"/>
</imageView>
<navigationBar contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NOA-Dm-cuz">
<rect key="frame" x="0.0" y="20" width="320" height="44"/>
<items>
<navigationItem id="3HJ-uW-3hn">
<barButtonItem key="leftBarButtonItem" title="Done" style="done" id="WYi-yp-eM6">
<connections>
<action selector="DoneClicked" destination="ObA-dk-sSI" id="Qdu-qn-U6V"/>
</connections>
</barButtonItem>
</navigationItem>
</items>
</navigationBar>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="NOA-Dm-cuz" secondAttribute="trailing" id="A05-Pj-hrr"/>
<constraint firstItem="9ga-4F-77Z" firstAttribute="top" secondItem="NOA-Dm-cuz" secondAttribute="bottom" id="Fps-3D-QQW"/>
<constraint firstItem="NOA-Dm-cuz" firstAttribute="leading" secondItem="zMn-AG-sqS" secondAttribute="leading" id="HxO-8t-aoh"/>
<constraint firstAttribute="trailing" secondItem="9ga-4F-77Z" secondAttribute="trailing" id="Ozw-Hg-0yh"/>
<constraint firstItem="9ga-4F-77Z" firstAttribute="leading" secondItem="zMn-AG-sqS" secondAttribute="leading" id="XH5-ld-ONA"/>
<constraint firstItem="n38-gi-rB5" firstAttribute="top" secondItem="9ga-4F-77Z" secondAttribute="bottom" id="eQg-nn-Zy4"/>
<constraint firstItem="NOA-Dm-cuz" firstAttribute="top" secondItem="qkL-Od-lgU" secondAttribute="bottom" id="we0-1t-bgp"/>
</constraints>
</view>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<size key="freeformSize" width="320" height="528"/>
<connections>
<outlet property="imageView" destination="9ga-4F-77Z" id="5y6-5w-9QO"/>
<outlet property="view" destination="zMn-AG-sqS" id="Qma-de-2ek"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="X47-rx-isc" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="252" y="-124"/>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>

View file

@ -95,10 +95,10 @@
</Compile>
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
<InterfaceDefinition Include="ActionViewController.xib" />
<None Include="Info.plist" />
<None Include="Entitlements.plist" />
<Compile Include="Properties\AssemblyInfo.cs" />
<InterfaceDefinition Include="MainInterface.storyboard" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>