UI updates to ios extension

This commit is contained in:
Kyle Spearrin 2016-06-11 01:17:08 -04:00
parent e22918a562
commit afbc5a903b
7 changed files with 67 additions and 32 deletions

View File

@ -145,6 +145,7 @@ Global
{1F78403F-9A28-405B-9289-B9DBEB55F074}.Debug|x64.ActiveCfg = Debug|iPhone
{1F78403F-9A28-405B-9289-B9DBEB55F074}.Debug|x86.ActiveCfg = Debug|iPhone
{1F78403F-9A28-405B-9289-B9DBEB55F074}.Release|Any CPU.ActiveCfg = Release|iPhone
{1F78403F-9A28-405B-9289-B9DBEB55F074}.Release|Any CPU.Build.0 = Release|iPhone
{1F78403F-9A28-405B-9289-B9DBEB55F074}.Release|ARM.ActiveCfg = Release|iPhone
{1F78403F-9A28-405B-9289-B9DBEB55F074}.Release|iPhone.ActiveCfg = Release|iPhone
{1F78403F-9A28-405B-9289-B9DBEB55F074}.Release|iPhone.Build.0 = Release|iPhone
@ -274,6 +275,7 @@ Global
{32F5A2D6-F54D-4DA1-AE26-0A980D48F422}.Debug|x64.ActiveCfg = Debug|iPhone
{32F5A2D6-F54D-4DA1-AE26-0A980D48F422}.Debug|x86.ActiveCfg = Debug|iPhone
{32F5A2D6-F54D-4DA1-AE26-0A980D48F422}.Release|Any CPU.ActiveCfg = Release|iPhone
{32F5A2D6-F54D-4DA1-AE26-0A980D48F422}.Release|Any CPU.Build.0 = Release|iPhone
{32F5A2D6-F54D-4DA1-AE26-0A980D48F422}.Release|ARM.ActiveCfg = Release|iPhone
{32F5A2D6-F54D-4DA1-AE26-0A980D48F422}.Release|iPhone.ActiveCfg = Release|iPhone
{32F5A2D6-F54D-4DA1-AE26-0A980D48F422}.Release|iPhone.Build.0 = Release|iPhone

View File

@ -22,18 +22,15 @@ namespace Bit.iOS.Extension
public override void ViewDidLoad()
{
base.ViewDidLoad();
View.BackgroundColor = UIColor.FromPatternImage(new UIImage("boxed-bg.png"));
NavigationController.NavigationBar.TintColor = UIColor.White;
NavigationController.NavigationBar.BarTintColor = new UIColor(0.24f, 0.55f, 0.74f, 1.0f);
NavigationController.NavigationBar.TitleTextAttributes = new UIStringAttributes() { ForegroundColor = UIColor.White };
List<string> sites = new List<string>();
List<Tuple<string, string>> sites = new List<Tuple<string, string>>();
for(int i = 1; i <= 100; i++)
{
sites.Add("Site " + i);
sites.Add(new Tuple<string, string>("Site " + i, "Username " + i));
}
tableView.Source = new TableSource(sites, this);
AutomaticallyAdjustsScrollViewInsets = false;
}
partial void CancelClicked(UIBarButtonItem sender)
@ -54,11 +51,11 @@ namespace Bit.iOS.Extension
{
private const string CellIdentifier = "TableCell";
private IEnumerable<string> _tableItems;
private IEnumerable<Tuple<string, string>> _tableItems;
private Context _context;
private ActionViewController _controller;
public TableSource(IEnumerable<string> items, ActionViewController controller)
public TableSource(IEnumerable<Tuple<string, string>> items, ActionViewController controller)
{
_tableItems = items;
_context = controller.Context;
@ -78,10 +75,11 @@ namespace Bit.iOS.Extension
// if there are no cells to reuse, create a new one
if(cell == null)
{
cell = new UITableViewCell(UITableViewCellStyle.Default, CellIdentifier);
cell = new UITableViewCell(UITableViewCellStyle.Subtitle, CellIdentifier);
}
cell.TextLabel.Text = item;
cell.TextLabel.Text = item.Item1;
cell.DetailTextLabel.Text = item.Item2;
return cell;
}

View File

@ -14,10 +14,6 @@ namespace Bit.iOS.Extension
[Register ("ActionViewController")]
partial class ActionViewController
{
[Outlet]
[GeneratedCode ("iOS Designer", "1.0")]
UINavigationItem NavItem { get; set; }
[Outlet]
[GeneratedCode ("iOS Designer", "1.0")]
UITableView tableView { get; set; }
@ -31,10 +27,6 @@ namespace Bit.iOS.Extension
void ReleaseDesignerOutlets ()
{
if (NavItem != null) {
NavItem.Dispose ();
NavItem = null;
}
if (tableView != null) {
tableView.Dispose ();
tableView = null;

View File

@ -28,8 +28,7 @@ namespace Bit.iOS.Extension
public override void ViewDidLoad()
{
base.ViewDidLoad();
View.BackgroundColor = UIColor.FromPatternImage(new UIImage("boxed-bg.png"));
NavigationController.SetNavigationBarHidden(true, false);
View.BackgroundColor = UIColor.FromPatternImage(new UIImage("bg.png"));
_context.ExtContext = ExtensionContext;
}

View File

@ -17,14 +17,48 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" colorSpace="calibratedWhite" white="1" alpha="1"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="1717" translatesAutoresizingMaskIntoConstraints="NO">
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="1823" translatesAutoresizingMaskIntoConstraints="NO">
<rect key="frame" x="0.0" y="64" width="600" height="536"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="1722" rowHeight="44">
<tableViewCell contentMode="scaleToFill" selectionStyle="gray" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="1824" rowHeight="44" style="IBUITableViewCellStyleSubtitle" textLabel="1834" detailTextLabel="1835">
<rect key="frame" x="0.0" y="22" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="1723" tableViewCell="1722">
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="1825" tableViewCell="1824">
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="1834">
<rect key="frame" x="15" y="4" width="35.5" height="21.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Subtitle" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="1835">
<rect key="frame" x="15" y="25.5" width="44" height="14.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</view>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="1826" rowHeight="44">
<rect key="frame" x="0.0" y="66" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="1827" tableViewCell="1826">
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="1828" rowHeight="44">
<rect key="frame" x="0.0" y="110" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="1829" tableViewCell="1828">
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
@ -34,10 +68,10 @@
</tableView>
</subviews>
<constraints>
<constraint id="1753" firstItem="1717" firstAttribute="top" secondItem="qkL-Od-lgU" secondAttribute="bottom"/>
<constraint id="1754" firstItem="1717" firstAttribute="leading" secondItem="zMn-AG-sqS" secondAttribute="leading"/>
<constraint id="1755" firstItem="1717" firstAttribute="trailing" secondItem="zMn-AG-sqS" secondAttribute="trailing"/>
<constraint id="1756" firstItem="1717" firstAttribute="bottom" secondItem="n38-gi-rB5" secondAttribute="top"/>
<constraint id="1830" firstItem="1823" firstAttribute="top" secondItem="qkL-Od-lgU" secondAttribute="bottom"/>
<constraint id="1831" firstItem="zMn-AG-sqS" firstAttribute="bottom" secondItem="1823" secondAttribute="bottom"/>
<constraint id="1832" firstItem="1823" firstAttribute="leading" secondItem="zMn-AG-sqS" secondAttribute="leading"/>
<constraint id="1833" firstItem="zMn-AG-sqS" firstAttribute="trailing" secondItem="1823" secondAttribute="trailing"/>
</constraints>
</view>
<navigationItem key="navigationItem" id="yHH-Ee-etX" title="Sites">
@ -45,10 +79,11 @@
<connections>
<action selector="CancelClicked:" destination="ObA-dk-sSI" id="1729"/>
</connections>
<color key="tintColor" colorSpace="calibratedWhite" white="1" alpha="1"/>
</barButtonItem>
</navigationItem>
<connections>
<outlet property="tableView" destination="1717" id="name-outlet-1717"/>
<outlet property="tableView" destination="1823" id="name-outlet-1823"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="X47-rx-isc" userLabel="First Responder" sceneMemberID="firstResponder"/>
@ -67,11 +102,15 @@
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" id="1713" translatesAutoresizingMaskIntoConstraints="NO" fixedFrame="YES" image="logo.png">
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" id="1713" translatesAutoresizingMaskIntoConstraints="NO" image="logo.png">
<rect key="frame" x="159" y="278" width="282" height="44"/>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint id="1763" firstItem="1713" firstAttribute="centerY" secondItem="44" secondAttribute="centerY"/>
<constraint id="1764" firstItem="1713" firstAttribute="centerX" secondItem="44" secondAttribute="centerX"/>
</constraints>
</view>
<connections>
<segue destination="oCZ-GQ-aOK" kind="show" identifier="seque" id="1679"/>
@ -85,7 +124,7 @@
<scene sceneID="63">
<objects>
<navigationController definesPresentationContext="YES" id="64" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="67">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="67" translucent="NO" hidden="YES">
<rect key="frame" x="0.0" y="20" width="880" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
</navigationBar>
@ -102,9 +141,13 @@
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="oCZ-GQ-aOK" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="8A5-AR-QHS">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="8A5-AR-QHS" translucent="NO">
<rect key="frame" x="0.0" y="20" width="880" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<textAttributes key="titleTextAttributes">
<color key="textColor" colorSpace="calibratedWhite" white="1" alpha="1"/>
</textAttributes>
<color key="barTintColor" colorSpace="calibratedRGB" red="0.23529411764705882" green="0.55294117647058827" blue="0.73725490196078436" alpha="1"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
@ -120,5 +163,6 @@
<image name="logo.png" width="282" height="44"/>
<image name="Icon.png" width="57" height="57"/>
<image name="boxed-bg.png" width="400" height="400"/>
<image name="bg.png" width="400" height="400"/>
</resources>
</document>

View File

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

@ -148,7 +148,7 @@
<BundleResource Include="Resources\Icon.png" />
<BundleResource Include="Resources\Icon%402x.png" />
<BundleResource Include="Resources\Icon%403x.png" />
<BundleResource Include="Resources\boxed-bg.png" />
<BundleResource Include="Resources\bg.png" />
<BundleResource Include="Resources\logo.png" />
<BundleResource Include="Resources\logo%402x.png" />
<BundleResource Include="Resources\logo%403x.png" />