revert back to default ios bar color. Added new Add Site view controller for extension (WIP)

This commit is contained in:
Kyle Spearrin 2016-07-07 20:53:01 -04:00
parent e7c78f6efa
commit 135f323372
10 changed files with 328 additions and 17 deletions

View file

@ -13,19 +13,12 @@ namespace Bit.App.Controls
public static readonly BindableProperty TintColorProperty = public static readonly BindableProperty TintColorProperty =
BindableProperty.Create(nameof(TintColor), typeof(Color), typeof(ExtendedTabbedPage), Color.White); BindableProperty.Create(nameof(TintColor), typeof(Color), typeof(ExtendedTabbedPage), Color.White);
public static readonly BindableProperty BarTintColorProperty =
BindableProperty.Create(nameof(BarTintColor), typeof(Color), typeof(ExtendedTabbedPage), Color.White);
public Color TintColor public Color TintColor
{ {
get { return (Color)GetValue(TintColorProperty); } get { return (Color)GetValue(TintColorProperty); }
set { SetValue(TintColorProperty, value); } set { SetValue(TintColorProperty, value); }
} }
public Color BarTintColor public bool NoBorder { get; set; }
{
get { return (Color)GetValue(BarTintColorProperty); }
set { SetValue(BarTintColorProperty, value); }
}
} }
} }

View file

@ -9,8 +9,7 @@ namespace Bit.App.Pages
{ {
public MainPage() public MainPage()
{ {
BarTintColor = Color.FromHex("222d32"); TintColor = Color.FromHex("3c8dbc");
TintColor = Color.FromHex("ffffff");
var settingsNavigation = new ExtendedNavigationPage(new SettingsPage()); var settingsNavigation = new ExtendedNavigationPage(new SettingsPage());
var favoritesNavigation = new ExtendedNavigationPage(new VaultListSitesPage(true)); var favoritesNavigation = new ExtendedNavigationPage(new VaultListSitesPage(true));

View file

@ -63,6 +63,24 @@ namespace Bit.iOS.Extension
Context.ExtContext.CompleteRequest(returningItems, null); Context.ExtContext.CompleteRequest(returningItems, null);
} }
partial void UIBarButtonItem2293_Activated(UIBarButtonItem sender)
{
PerformSegue("addSiteSegue", this);
}
public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender)
{
var navController = segue.DestinationViewController as UINavigationController;
if(navController != null)
{
var addSiteController = navController.TopViewController as AddSiteViewController;
if(addSiteController != null)
{
addSiteController.Context = Context;
}
}
}
public class TableSource : UITableViewSource public class TableSource : UITableViewSource
{ {
private const string CellIdentifier = "TableCell"; private const string CellIdentifier = "TableCell";

View file

@ -25,6 +25,10 @@ namespace Bit.iOS.Extension
[GeneratedCode ("iOS Designer", "1.0")] [GeneratedCode ("iOS Designer", "1.0")]
partial void CancelClicked (UIBarButtonItem sender); partial void CancelClicked (UIBarButtonItem sender);
[Action ("UIBarButtonItem2293_Activated:")]
[GeneratedCode ("iOS Designer", "1.0")]
partial void UIBarButtonItem2293_Activated (UIBarButtonItem sender);
void ReleaseDesignerOutlets () void ReleaseDesignerOutlets ()
{ {
if (tableView != null) { if (tableView != null) {

View file

@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Bit.App.Abstractions;
using Bit.App.Models;
using Bit.iOS.Core;
using Bit.iOS.Extension.Models;
using Foundation;
using MobileCoreServices;
using Newtonsoft.Json;
using UIKit;
using XLabs.Ioc;
namespace Bit.iOS.Extension
{
public partial class AddSiteViewController : UITableViewController
{
public AddSiteViewController(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()
{
tableView.RowHeight = UITableView.AutomaticDimension;
tableView.EstimatedRowHeight = 44;
base.ViewDidLoad();
}
partial void UIBarButtonItem2289_Activated(UIBarButtonItem sender)
{
DismissViewController(true, null);
}
partial void UIBarButtonItem2290_Activated(UIBarButtonItem sender)
{
DismissViewController(true, null);
}
}
}

View file

@ -0,0 +1,61 @@
// 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 ("AddSiteViewController")]
partial class AddSiteViewController
{
[Outlet]
[GeneratedCode ("iOS Designer", "1.0")]
UITableViewCell nameCell { get; set; }
[Outlet]
[GeneratedCode ("iOS Designer", "1.0")]
UITextField nameField { get; set; }
[Outlet]
[GeneratedCode ("iOS Designer", "1.0")]
UILabel nameLabel { get; set; }
[Outlet]
[GeneratedCode ("iOS Designer", "1.0")]
UITableView tableView { get; set; }
[Action ("UIBarButtonItem2289_Activated:")]
[GeneratedCode ("iOS Designer", "1.0")]
partial void UIBarButtonItem2289_Activated (UIBarButtonItem sender);
[Action ("UIBarButtonItem2290_Activated:")]
[GeneratedCode ("iOS Designer", "1.0")]
partial void UIBarButtonItem2290_Activated (UIBarButtonItem sender);
void ReleaseDesignerOutlets ()
{
if (nameCell != null) {
nameCell.Dispose ();
nameCell = null;
}
if (nameField != null) {
nameField.Dispose ();
nameField = null;
}
if (nameLabel != null) {
nameLabel.Dispose ();
nameLabel = null;
}
if (tableView != null) {
tableView.Dispose ();
tableView = null;
}
}
}
}

View file

@ -65,7 +65,7 @@ namespace Bit.iOS.Extension
public override void ViewDidAppear(bool animated) public override void ViewDidAppear(bool animated)
{ {
base.ViewDidAppear(animated); base.ViewDidAppear(animated);
PerformSegue("seque", this); PerformSegue("siteListSegue", this);
} }
public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender) public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender)

View file

@ -81,14 +81,26 @@
</connections> </connections>
<color key="tintColor" colorSpace="calibratedWhite" white="1" alpha="1"/> <color key="tintColor" colorSpace="calibratedWhite" white="1" alpha="1"/>
</barButtonItem> </barButtonItem>
<barButtonItem title="Add" id="2293" translatesAutoresizingMaskIntoConstraints="NO" key="rightBarButtonItem">
<accessibilityConfiguration key="accessibilityConfiguration" label="Add Site">
<traits key="traits" button="YES"/>
<isElement key="isElement" value="YES"/>
</accessibilityConfiguration>
<userDefinedRuntimeAttribute key="userDefinedRuntimeAttribute"/>
<color key="tintColor" colorSpace="calibratedWhite" white="1" alpha="1"/>
<connections>
<action selector="UIBarButtonItem2293_Activated:" destination="ObA-dk-sSI" id="2294"/>
</connections>
</barButtonItem>
</navigationItem> </navigationItem>
<connections> <connections>
<outlet property="tableView" destination="1823" id="name-outlet-1823"/> <outlet property="tableView" destination="1823" id="name-outlet-1823"/>
<segue id="2084" destination="1845" kind="presentation" modalPresentationStyle="fullScreen" modalTransitionStyle="coverVertical" identifier="addSiteSegue"/>
</connections> </connections>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="X47-rx-isc" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="X47-rx-isc" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="1133" y="555"/> <point key="canvasLocation" x="1114" y="556"/>
</scene> </scene>
<!--Splash View Controller--> <!--Splash View Controller-->
<scene sceneID="42"> <scene sceneID="42">
@ -113,7 +125,7 @@
</constraints> </constraints>
</view> </view>
<connections> <connections>
<segue destination="oCZ-GQ-aOK" kind="show" identifier="seque" id="1679"/> <segue destination="oCZ-GQ-aOK" kind="show" identifier="siteListSegue" id="1679"/>
</connections> </connections>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="45" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="45" userLabel="First Responder" sceneMemberID="firstResponder"/>
@ -158,6 +170,174 @@
</objects> </objects>
<point key="canvasLocation" x="399" y="561"/> <point key="canvasLocation" x="399" y="561"/>
</scene> </scene>
<scene sceneID="1844">
<objects>
<navigationController definesPresentationContext="YES" id="1845" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="1848" translucent="NO">
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<rect key="frame" x="0.0" y="20" width="880" height="44"/>
<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>
<connections>
<segue id="2253" destination="2087" kind="relationship" relationship="rootViewController"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="1849" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1900" y="562"/>
</scene>
<scene sceneID="2086">
<objects>
<tableViewController id="2087" sceneMemberID="viewController" customClass="AddSiteViewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" rowHeight="50" sectionHeaderHeight="22" sectionFooterHeight="22" id="2088" opaque="NO">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<outlet property="dataSource" destination="2087" id="2089"/>
<outlet property="delegate" destination="2087" id="2090"/>
</connections>
<sections>
<tableViewSection headerTitle="Site Information" id="2266" footerTitle=" ">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="2267" rowHeight="100">
<rect key="frame" x="0.0" y="55.5" width="600" height="100"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2267" id="2268">
<rect key="frame" x="0.0" y="0.0" width="600" height="99.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Name" lineBreakMode="tailTruncation" minimumFontSize="10" id="2316" translatesAutoresizingMaskIntoConstraints="NO">
<rect key="frame" x="0.0" y="12" width="600" height="21"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" cocoaTouchSystemColor="scrollViewTexturedBackgroundColor"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="Text" minimumFontSize="17" id="2317" translatesAutoresizingMaskIntoConstraints="NO" preservesSuperviewLayoutMargins="YES" clearButtonMode="whileEditing">
<rect key="frame" x="0.0" y="41" width="600" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews>
<constraints>
<constraint id="2318" firstItem="2317" firstAttribute="leading" secondItem="2268" secondAttribute="leading" constant="15"/>
<constraint id="2319" firstItem="2268" firstAttribute="trailing" secondItem="2317" secondAttribute="trailing" constant="15"/>
<constraint id="2320" firstItem="2268" firstAttribute="bottom" secondItem="2317" secondAttribute="bottom" constant="15"/>
<constraint id="2323" firstItem="2268" firstAttribute="trailing" secondItem="2316" secondAttribute="trailing" constant="10"/>
<constraint id="2325" firstItem="2316" firstAttribute="leading" secondItem="2268" secondAttribute="leading" constant="10"/>
<constraint id="2326" firstItem="2316" firstAttribute="top" secondItem="2268" secondAttribute="top" constant="15"/>
<constraint id="2328" firstItem="2317" firstAttribute="top" secondItem="2316" secondAttribute="bottom" constant="10"/>
</constraints>
</tableViewCellContentView>
<edgeInsets key="layoutMargins" top="10" left="15" bottom="10" right="15"/>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="2269" rowHeight="44">
<rect key="frame" x="0.0" y="155.5" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2269" id="2270">
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="2271" rowHeight="44">
<rect key="frame" x="0.0" y="199.5" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2271" id="2272">
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="2280" rowHeight="44">
<rect key="frame" x="0.0" y="243.5" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2280" id="2281">
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="2305" rowHeight="44" style="IBUITableViewCellStyleDefault" textLabel="2307" accessoryType="disclosureIndicator">
<rect key="frame" x="0.0" y="287.5" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2305" id="2306">
<rect key="frame" x="0.0" y="0.0" width="562" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Generate Password" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="2307">
<rect key="frame" x="20" y="0.0" width="542" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection id="2273" headerTitle=" " footerTitle=" ">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="2274" rowHeight="44">
<rect key="frame" x="0.0" y="768.5" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2274" id="2275">
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="2276" rowHeight="44">
<rect key="frame" x="0.0" y="812.5" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2276" id="2277">
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="Notes" id="2282" footerTitle=" ">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="2283" rowHeight="44">
<rect key="frame" x="0.0" y="1095.5" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2283" id="2284">
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<color key="sectionIndexBackgroundColor" colorSpace="calibratedWhite" white="0" alpha="0"/>
</tableView>
<navigationItem title="Add Site" id="2252" key="navigationItem">
<barButtonItem title="Cancel" id="2289" translatesAutoresizingMaskIntoConstraints="NO" key="leftBarButtonItem">
<connections>
<action selector="UIBarButtonItem2289_Activated:" destination="2087" id="2291"/>
</connections>
<color key="tintColor" colorSpace="calibratedWhite" white="1" alpha="1"/>
</barButtonItem>
<barButtonItem title="Save" id="2290" translatesAutoresizingMaskIntoConstraints="NO" key="rightBarButtonItem">
<connections>
<action selector="UIBarButtonItem2290_Activated:" destination="2087" id="2292"/>
</connections>
<color key="tintColor" colorSpace="calibratedWhite" white="1" alpha="1"/>
</barButtonItem>
</navigationItem>
<connections>
<outlet property="tableView" destination="2088" id="name-outlet-2088"/>
<outlet property="nameField" destination="2317" id="name-outlet-2317"/>
<outlet property="nameLabel" destination="2316" id="name-outlet-2316"/>
<outlet property="nameCell" destination="2267" id="name-outlet-2267"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="2093" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2644" y="570"/>
</scene>
</scenes> </scenes>
<resources> <resources>
<image name="logo.png" width="282" height="44"/> <image name="logo.png" width="282" height="44"/>

View file

@ -95,6 +95,10 @@
<CodesignKey>iPhone Distribution</CodesignKey> <CodesignKey>iPhone Distribution</CodesignKey>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="AddSiteViewController.cs" />
<Compile Include="AddSiteViewController.designer.cs">
<DependentUpon>AddSiteViewController.cs</DependentUpon>
</Compile>
<Compile Include="ActionViewController.cs" /> <Compile Include="ActionViewController.cs" />
<Compile Include="ActionViewController.designer.cs"> <Compile Include="ActionViewController.designer.cs">
<DependentUpon>ActionViewController.cs</DependentUpon> <DependentUpon>ActionViewController.cs</DependentUpon>

View file

@ -18,13 +18,15 @@ namespace Bit.iOS.Controls
var page = (ExtendedTabbedPage)Element; var page = (ExtendedTabbedPage)Element;
TabBar.TintColor = page.TintColor.ToUIColor(); TabBar.TintColor = page.TintColor.ToUIColor();
TabBar.BarTintColor = page.BarTintColor.ToUIColor();
TabBar.BackgroundColor = page.BackgroundColor.ToUIColor(); TabBar.BackgroundColor = page.BackgroundColor.ToUIColor();
if(page.NoBorder)
{
// remove top border // remove top border
// ref: http://stackoverflow.com/questions/14371343/ios-uitabbar-remove-top-shadow-gradient-line // ref: http://stackoverflow.com/questions/14371343/ios-uitabbar-remove-top-shadow-gradient-line
TabBar.SetValueForKeyPath(FromObject(true), new NSString("_hidesShadow")); TabBar.SetValueForKeyPath(FromObject(true), new NSString("_hidesShadow"));
} }
}
public override void ViewWillAppear(bool animated) public override void ViewWillAppear(bool animated)
{ {