From afbc5a903bb9e294cd4f9546c9de39c3338b222d Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Sat, 11 Jun 2016 01:17:08 -0400 Subject: [PATCH] UI updates to ios extension --- bitwarden-mobile.sln | 2 + src/iOS.Extension/ActionViewController.cs | 18 +++-- .../ActionViewController.designer.cs | 8 --- src/iOS.Extension/LoadingViewController.cs | 3 +- src/iOS.Extension/MainInterface.storyboard | 66 +++++++++++++++--- .../Resources/{boxed-bg.png => bg.png} | Bin src/iOS.Extension/iOS.Extension.csproj | 2 +- 7 files changed, 67 insertions(+), 32 deletions(-) rename src/iOS.Extension/Resources/{boxed-bg.png => bg.png} (100%) diff --git a/bitwarden-mobile.sln b/bitwarden-mobile.sln index 516491231..25f511fbc 100644 --- a/bitwarden-mobile.sln +++ b/bitwarden-mobile.sln @@ -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 diff --git a/src/iOS.Extension/ActionViewController.cs b/src/iOS.Extension/ActionViewController.cs index 0c2ffcc0a..4f68379f2 100644 --- a/src/iOS.Extension/ActionViewController.cs +++ b/src/iOS.Extension/ActionViewController.cs @@ -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 sites = new List(); + List> sites = new List>(); for(int i = 1; i <= 100; i++) { - sites.Add("Site " + i); + sites.Add(new Tuple("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 _tableItems; + private IEnumerable> _tableItems; private Context _context; private ActionViewController _controller; - public TableSource(IEnumerable items, ActionViewController controller) + public TableSource(IEnumerable> 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; } diff --git a/src/iOS.Extension/ActionViewController.designer.cs b/src/iOS.Extension/ActionViewController.designer.cs index 85385a2e2..62193b091 100644 --- a/src/iOS.Extension/ActionViewController.designer.cs +++ b/src/iOS.Extension/ActionViewController.designer.cs @@ -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; diff --git a/src/iOS.Extension/LoadingViewController.cs b/src/iOS.Extension/LoadingViewController.cs index 3950b0042..79441c0f1 100644 --- a/src/iOS.Extension/LoadingViewController.cs +++ b/src/iOS.Extension/LoadingViewController.cs @@ -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; } diff --git a/src/iOS.Extension/MainInterface.storyboard b/src/iOS.Extension/MainInterface.storyboard index 04206fe30..4bb797dd8 100644 --- a/src/iOS.Extension/MainInterface.storyboard +++ b/src/iOS.Extension/MainInterface.storyboard @@ -17,14 +17,48 @@ - + - + - + + + + + + + + + + + + + + + + + + + + + + + @@ -34,10 +68,10 @@ - - - - + + + + @@ -45,10 +79,11 @@ + - + @@ -67,11 +102,15 @@ - + + + + + @@ -85,7 +124,7 @@ - + @@ -102,9 +141,13 @@ - + + + + + @@ -120,5 +163,6 @@ + \ No newline at end of file diff --git a/src/iOS.Extension/Resources/boxed-bg.png b/src/iOS.Extension/Resources/bg.png similarity index 100% rename from src/iOS.Extension/Resources/boxed-bg.png rename to src/iOS.Extension/Resources/bg.png diff --git a/src/iOS.Extension/iOS.Extension.csproj b/src/iOS.Extension/iOS.Extension.csproj index eb16d6d16..f8df70a27 100644 --- a/src/iOS.Extension/iOS.Extension.csproj +++ b/src/iOS.Extension/iOS.Extension.csproj @@ -148,7 +148,7 @@ - +