From 066e48a72193378b32808ad1193ad2644ac424da Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Sat, 9 Jul 2016 02:01:23 -0400 Subject: [PATCH] standardized view controller and property names a bit for extension. --- .../ActionViewController.designer.cs | 40 ---- .../AddSiteViewController.designer.cs | 37 ---- src/iOS.Extension/LoadingViewController.cs | 2 +- src/iOS.Extension/MainInterface.storyboard | 187 ++++++++---------- ...Controller.cs => SiteAddViewController.cs} | 18 +- .../SiteAddViewController.designer.cs | 53 +++++ ...ontroller.cs => SiteListViewController.cs} | 24 ++- .../SiteListViewController.designer.cs | 61 ++++++ src/iOS.Extension/iOS.Extension.csproj | 12 +- 9 files changed, 220 insertions(+), 214 deletions(-) delete mode 100644 src/iOS.Extension/ActionViewController.designer.cs delete mode 100644 src/iOS.Extension/AddSiteViewController.designer.cs rename src/iOS.Extension/{AddSiteViewController.cs => SiteAddViewController.cs} (91%) create mode 100644 src/iOS.Extension/SiteAddViewController.designer.cs rename src/iOS.Extension/{ActionViewController.cs => SiteListViewController.cs} (90%) create mode 100644 src/iOS.Extension/SiteListViewController.designer.cs diff --git a/src/iOS.Extension/ActionViewController.designer.cs b/src/iOS.Extension/ActionViewController.designer.cs deleted file mode 100644 index 3f53f1aa4..000000000 --- a/src/iOS.Extension/ActionViewController.designer.cs +++ /dev/null @@ -1,40 +0,0 @@ -// 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 ("ActionViewController")] - partial class ActionViewController - { - [Outlet] - [GeneratedCode ("iOS Designer", "1.0")] - UITableView tableView { get; set; } - - [Action ("DoneClicked:")] - partial void DoneClicked (Foundation.NSObject sender); - - [Action ("CancelClicked:")] - [GeneratedCode ("iOS Designer", "1.0")] - partial void CancelClicked (UIBarButtonItem sender); - - [Action ("UIBarButtonItem2293_Activated:")] - [GeneratedCode ("iOS Designer", "1.0")] - partial void UIBarButtonItem2293_Activated (UIBarButtonItem sender); - - void ReleaseDesignerOutlets () - { - if (tableView != null) { - tableView.Dispose (); - tableView = null; - } - } - } -} diff --git a/src/iOS.Extension/AddSiteViewController.designer.cs b/src/iOS.Extension/AddSiteViewController.designer.cs deleted file mode 100644 index bc623816d..000000000 --- a/src/iOS.Extension/AddSiteViewController.designer.cs +++ /dev/null @@ -1,37 +0,0 @@ -// 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")] - 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 (tableView != null) { - tableView.Dispose (); - tableView = null; - } - } - } -} diff --git a/src/iOS.Extension/LoadingViewController.cs b/src/iOS.Extension/LoadingViewController.cs index d2c2af1f9..aa82c8cb7 100644 --- a/src/iOS.Extension/LoadingViewController.cs +++ b/src/iOS.Extension/LoadingViewController.cs @@ -73,7 +73,7 @@ namespace Bit.iOS.Extension var navController = segue.DestinationViewController as UINavigationController; if(navController != null) { - var actionController = navController.TopViewController as ActionViewController; + var actionController = navController.TopViewController as SiteListViewController; if(actionController != null) { actionController.Context = _context; diff --git a/src/iOS.Extension/MainInterface.storyboard b/src/iOS.Extension/MainInterface.storyboard index 19c844cd6..3106785fa 100644 --- a/src/iOS.Extension/MainInterface.storyboard +++ b/src/iOS.Extension/MainInterface.storyboard @@ -5,103 +5,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -163,7 +66,7 @@ - + @@ -191,7 +94,7 @@ - + @@ -204,27 +107,95 @@ - - - - + + + + - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/iOS.Extension/AddSiteViewController.cs b/src/iOS.Extension/SiteAddViewController.cs similarity index 91% rename from src/iOS.Extension/AddSiteViewController.cs rename to src/iOS.Extension/SiteAddViewController.cs index e2cc48837..8e24bbe2f 100644 --- a/src/iOS.Extension/AddSiteViewController.cs +++ b/src/iOS.Extension/SiteAddViewController.cs @@ -12,9 +12,9 @@ using UIKit; namespace Bit.iOS.Extension { - public partial class AddSiteViewController : UITableViewController + public partial class SiteAddViewController : UITableViewController { - public AddSiteViewController(IntPtr handle) : base(handle) + public SiteAddViewController(IntPtr handle) : base(handle) { } public Context Context { get; set; } @@ -76,28 +76,28 @@ namespace Bit.iOS.Extension GeneratePasswordCell.TextLabel.Text = "Generate Password"; GeneratePasswordCell.Accessory = UITableViewCellAccessory.DisclosureIndicator; - tableView.RowHeight = UITableView.AutomaticDimension; - tableView.EstimatedRowHeight = 70; - tableView.Source = new TableSource(this); + TableView.RowHeight = UITableView.AutomaticDimension; + TableView.EstimatedRowHeight = 70; + TableView.Source = new TableSource(this); base.ViewDidLoad(); } - partial void UIBarButtonItem2289_Activated(UIBarButtonItem sender) + partial void CancelBarButton_Activated(UIBarButtonItem sender) { DismissViewController(true, null); } - partial void UIBarButtonItem2290_Activated(UIBarButtonItem sender) + partial void SaveBarButton_Activated(UIBarButtonItem sender) { DismissViewController(true, null); } public class TableSource : UITableViewSource { - private AddSiteViewController _controller; + private SiteAddViewController _controller; - public TableSource(AddSiteViewController controller) + public TableSource(SiteAddViewController controller) { _controller = controller; } diff --git a/src/iOS.Extension/SiteAddViewController.designer.cs b/src/iOS.Extension/SiteAddViewController.designer.cs new file mode 100644 index 000000000..dc3dfacb5 --- /dev/null +++ b/src/iOS.Extension/SiteAddViewController.designer.cs @@ -0,0 +1,53 @@ +// 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 ("SiteAddViewController")] + partial class SiteAddViewController + { + [Outlet] + [GeneratedCode ("iOS Designer", "1.0")] + UIBarButtonItem CancelBarButton { get; set; } + + [Outlet] + [GeneratedCode ("iOS Designer", "1.0")] + UIBarButtonItem SaveBarButton { get; set; } + + [Outlet] + [GeneratedCode ("iOS Designer", "1.0")] + UITableView TableView { get; set; } + + [Action ("CancelBarButton_Activated:")] + [GeneratedCode ("iOS Designer", "1.0")] + partial void CancelBarButton_Activated (UIBarButtonItem sender); + + [Action ("SaveBarButton_Activated:")] + [GeneratedCode ("iOS Designer", "1.0")] + partial void SaveBarButton_Activated (UIBarButtonItem sender); + + void ReleaseDesignerOutlets () + { + if (CancelBarButton != null) { + CancelBarButton.Dispose (); + CancelBarButton = null; + } + if (SaveBarButton != null) { + SaveBarButton.Dispose (); + SaveBarButton = null; + } + if (TableView != null) { + TableView.Dispose (); + TableView = null; + } + } + } +} diff --git a/src/iOS.Extension/ActionViewController.cs b/src/iOS.Extension/SiteListViewController.cs similarity index 90% rename from src/iOS.Extension/ActionViewController.cs rename to src/iOS.Extension/SiteListViewController.cs index fd08c089b..c21fc043a 100644 --- a/src/iOS.Extension/ActionViewController.cs +++ b/src/iOS.Extension/SiteListViewController.cs @@ -14,9 +14,9 @@ using XLabs.Ioc; namespace Bit.iOS.Extension { - public partial class ActionViewController : UIViewController + public partial class SiteListViewController : UITableViewController { - public ActionViewController(IntPtr handle) : base(handle) + public SiteListViewController(IntPtr handle) : base(handle) { } public Context Context { get; set; } @@ -25,7 +25,6 @@ namespace Bit.iOS.Extension { UINavigationBar.Appearance.ShadowImage = new UIImage(); UINavigationBar.Appearance.SetBackgroundImage(new UIImage(), UIBarMetrics.Default); - base.ViewWillAppear(animated); } @@ -42,13 +41,12 @@ namespace Bit.iOS.Extension filteredSiteModels = siteModels.Where(s => s.Domain != null && s.Domain.BaseDomain == Context.DomainName.BaseDomain); } - tableView.RowHeight = UITableView.AutomaticDimension; - tableView.EstimatedRowHeight = 44; - tableView.Source = new TableSource(filteredSiteModels, this); - AutomaticallyAdjustsScrollViewInsets = false; + TableView.RowHeight = UITableView.AutomaticDimension; + TableView.EstimatedRowHeight = 44; + TableView.Source = new TableSource(filteredSiteModels, this); } - partial void CancelClicked(UIBarButtonItem sender) + partial void CancelBarButton_Activated(UIBarButtonItem sender) { CompleteRequest(null); } @@ -62,9 +60,9 @@ namespace Bit.iOS.Extension Context.ExtContext.CompleteRequest(returningItems, null); } - partial void UIBarButtonItem2293_Activated(UIBarButtonItem sender) + partial void AddBarButton_Activated(UIBarButtonItem sender) { - PerformSegue("addSiteSegue", this); + PerformSegue("siteAddSegue", this); } public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender) @@ -72,7 +70,7 @@ namespace Bit.iOS.Extension var navController = segue.DestinationViewController as UINavigationController; if(navController != null) { - var addSiteController = navController.TopViewController as AddSiteViewController; + var addSiteController = navController.TopViewController as SiteAddViewController; if(addSiteController != null) { addSiteController.Context = Context; @@ -86,9 +84,9 @@ namespace Bit.iOS.Extension private IEnumerable _tableItems; private Context _context; - private ActionViewController _controller; + private SiteListViewController _controller; - public TableSource(IEnumerable items, ActionViewController controller) + public TableSource(IEnumerable items, SiteListViewController controller) { _tableItems = items; _context = controller.Context; diff --git a/src/iOS.Extension/SiteListViewController.designer.cs b/src/iOS.Extension/SiteListViewController.designer.cs new file mode 100644 index 000000000..2ae5aed3b --- /dev/null +++ b/src/iOS.Extension/SiteListViewController.designer.cs @@ -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 ("SiteListViewController")] + partial class SiteListViewController + { + [Outlet] + [GeneratedCode ("iOS Designer", "1.0")] + UIBarButtonItem AddBarButton { get; set; } + + [Outlet] + [GeneratedCode ("iOS Designer", "1.0")] + UIBarButtonItem CancelBarButton { get; set; } + + [Outlet] + [GeneratedCode ("iOS Designer", "1.0")] + UINavigationItem NavItem { get; set; } + + [Outlet] + [GeneratedCode ("iOS Designer", "1.0")] + UITableView TableView { get; set; } + + [Action ("AddBarButton_Activated:")] + [GeneratedCode ("iOS Designer", "1.0")] + partial void AddBarButton_Activated (UIBarButtonItem sender); + + [Action ("CancelBarButton_Activated:")] + [GeneratedCode ("iOS Designer", "1.0")] + partial void CancelBarButton_Activated (UIBarButtonItem sender); + + void ReleaseDesignerOutlets () + { + if (AddBarButton != null) { + AddBarButton.Dispose (); + AddBarButton = null; + } + if (CancelBarButton != null) { + CancelBarButton.Dispose (); + CancelBarButton = null; + } + if (NavItem != null) { + NavItem.Dispose (); + NavItem = null; + } + if (TableView != null) { + TableView.Dispose (); + TableView = null; + } + } + } +} diff --git a/src/iOS.Extension/iOS.Extension.csproj b/src/iOS.Extension/iOS.Extension.csproj index ec4016ba8..a64220991 100644 --- a/src/iOS.Extension/iOS.Extension.csproj +++ b/src/iOS.Extension/iOS.Extension.csproj @@ -95,13 +95,13 @@ iPhone Distribution - - - AddSiteViewController.cs + + + SiteAddViewController.cs - - - ActionViewController.cs + + + SiteListViewController.cs