From ba63bf18ec395ebc4e5355b17962a4ba4df613c2 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 13 Jul 2016 00:39:24 -0400 Subject: [PATCH] stubbed out password generator pass in ios extension --- src/iOS.Extension/MainInterface.storyboard | 87 +++++++++++++- .../PasswordGeneratorViewController.cs | 108 ++++++++++++++++++ ...asswordGeneratorViewController.designer.cs | 73 ++++++++++++ src/iOS.Extension/iOS.Extension.csproj | 4 + 4 files changed, 269 insertions(+), 3 deletions(-) create mode 100644 src/iOS.Extension/PasswordGeneratorViewController.cs create mode 100644 src/iOS.Extension/PasswordGeneratorViewController.designer.cs diff --git a/src/iOS.Extension/MainInterface.storyboard b/src/iOS.Extension/MainInterface.storyboard index 3106785fa..9b3d91f38 100644 --- a/src/iOS.Extension/MainInterface.storyboard +++ b/src/iOS.Extension/MainInterface.storyboard @@ -40,7 +40,7 @@ @@ -57,7 +57,7 @@ - + @@ -78,7 +78,7 @@ - + @@ -124,6 +124,7 @@ + @@ -196,6 +197,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/iOS.Extension/PasswordGeneratorViewController.cs b/src/iOS.Extension/PasswordGeneratorViewController.cs new file mode 100644 index 000000000..0a123d03d --- /dev/null +++ b/src/iOS.Extension/PasswordGeneratorViewController.cs @@ -0,0 +1,108 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using Bit.App.Abstractions; +using Bit.App.Models; +using Bit.App.Resources; +using Bit.iOS.Core.Views; +using Bit.iOS.Extension.Models; +using Foundation; +using UIKit; +using XLabs.Ioc; +using Bit.App; +using Plugin.Connectivity.Abstractions; +using Bit.iOS.Core.Utilities; + +namespace Bit.iOS.Extension +{ + public partial class PasswordGeneratorViewController : UIViewController + { + public PasswordGeneratorViewController(IntPtr handle) : base(handle) + { } + + public Context Context { get; set; } + public SiteAddViewController Parent { 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() + { + View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f); + + base.ViewDidLoad(); + } + + partial void SelectBarButton_Activated(UIBarButtonItem sender) + { + throw new NotImplementedException(); + } + + partial void CancelBarButton_Activated(UIBarButtonItem sender) + { + throw new NotImplementedException(); + } + + public class TableSource : UITableViewSource + { + private PasswordGeneratorViewController _controller; + + public TableSource(PasswordGeneratorViewController controller) + { + _controller = controller; + } + + public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) + { + return new UITableViewCell(); + } + + public override nfloat GetHeightForRow(UITableView tableView, NSIndexPath indexPath) + { + return UITableView.AutomaticDimension; + } + + public override nint NumberOfSections(UITableView tableView) + { + return 3; + } + + public override nint RowsInSection(UITableView tableview, nint section) + { + if(section == 0) + { + return 5; + } + else if(section == 1) + { + return 2; + } + else + { + return 1; + } + } + + public override nfloat GetHeightForHeader(UITableView tableView, nint section) + { + return UITableView.AutomaticDimension; + } + + public override string TitleForHeader(UITableView tableView, nint section) + { + return null; + } + + public override void RowSelected(UITableView tableView, NSIndexPath indexPath) + { + tableView.DeselectRow(indexPath, true); + tableView.EndEditing(true); + } + } + } +} diff --git a/src/iOS.Extension/PasswordGeneratorViewController.designer.cs b/src/iOS.Extension/PasswordGeneratorViewController.designer.cs new file mode 100644 index 000000000..4a484f86e --- /dev/null +++ b/src/iOS.Extension/PasswordGeneratorViewController.designer.cs @@ -0,0 +1,73 @@ +// 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 ("PasswordGeneratorViewController")] + partial class PasswordGeneratorViewController + { + [Outlet] + [GeneratedCode ("iOS Designer", "1.0")] + UIKit.UIView BaseView { get; set; } + + [Outlet] + [GeneratedCode ("iOS Designer", "1.0")] + UIKit.UIBarButtonItem CancelBarButton { get; set; } + + [Outlet] + [GeneratedCode ("iOS Designer", "1.0")] + UIKit.UILabel PasswordLabel { get; set; } + + [Outlet] + [GeneratedCode ("iOS Designer", "1.0")] + UIKit.UIBarButtonItem SelectBarButton { get; set; } + + [Outlet] + [GeneratedCode ("iOS Designer", "1.0")] + UIKit.UITableView Table { get; set; } + + [Action ("CancelBarButton_Activated:")] + [GeneratedCode ("iOS Designer", "1.0")] + partial void CancelBarButton_Activated (UIKit.UIBarButtonItem sender); + + [Action ("SelectBarButton_Activated:")] + [GeneratedCode ("iOS Designer", "1.0")] + partial void SelectBarButton_Activated (UIKit.UIBarButtonItem sender); + + void ReleaseDesignerOutlets () + { + if (BaseView != null) { + BaseView.Dispose (); + BaseView = null; + } + + if (CancelBarButton != null) { + CancelBarButton.Dispose (); + CancelBarButton = null; + } + + if (PasswordLabel != null) { + PasswordLabel.Dispose (); + PasswordLabel = null; + } + + if (SelectBarButton != null) { + SelectBarButton.Dispose (); + SelectBarButton = null; + } + + if (Table != null) { + Table.Dispose (); + Table = null; + } + } + } +} \ No newline at end of file diff --git a/src/iOS.Extension/iOS.Extension.csproj b/src/iOS.Extension/iOS.Extension.csproj index aeb0ac75c..505c6ffb7 100644 --- a/src/iOS.Extension/iOS.Extension.csproj +++ b/src/iOS.Extension/iOS.Extension.csproj @@ -95,6 +95,10 @@ iPhone Distribution + + + PasswordGeneratorViewController.cs + SiteAddViewController.cs