mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 18:38:27 +03:00
ios app extension theming
This commit is contained in:
parent
73b5d1b3f1
commit
225db6397d
26 changed files with 284 additions and 155 deletions
|
@ -243,6 +243,7 @@ namespace Bit.iOS.Autofill
|
||||||
|
|
||||||
private void InitApp()
|
private void InitApp()
|
||||||
{
|
{
|
||||||
|
iOSCoreHelpers.AppearanceAdjustments();
|
||||||
if(ServiceContainer.RegisteredServices.Count > 0)
|
if(ServiceContainer.RegisteredServices.Count > 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -251,7 +252,6 @@ namespace Bit.iOS.Autofill
|
||||||
ServiceContainer.Init();
|
ServiceContainer.Init();
|
||||||
iOSCoreHelpers.RegisterHockeyApp();
|
iOSCoreHelpers.RegisterHockeyApp();
|
||||||
iOSCoreHelpers.Bootstrap();
|
iOSCoreHelpers.Bootstrap();
|
||||||
iOSCoreHelpers.AppearanceAdjustments();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -18,13 +18,6 @@ namespace Bit.iOS.Autofill
|
||||||
public Context Context { get; set; }
|
public Context Context { get; set; }
|
||||||
public CredentialProviderViewController CPViewController { get; set; }
|
public CredentialProviderViewController CPViewController { get; set; }
|
||||||
|
|
||||||
public override void ViewWillAppear(bool animated)
|
|
||||||
{
|
|
||||||
UINavigationBar.Appearance.ShadowImage = new UIImage();
|
|
||||||
UINavigationBar.Appearance.SetBackgroundImage(new UIImage(), UIBarMetrics.Default);
|
|
||||||
base.ViewWillAppear(animated);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async override void ViewDidLoad()
|
public async override void ViewDidLoad()
|
||||||
{
|
{
|
||||||
base.ViewDidLoad();
|
base.ViewDidLoad();
|
||||||
|
|
|
@ -6,6 +6,7 @@ using Bit.iOS.Core.Controllers;
|
||||||
using Bit.App.Resources;
|
using Bit.App.Resources;
|
||||||
using Bit.iOS.Core.Views;
|
using Bit.iOS.Core.Views;
|
||||||
using Bit.iOS.Autofill.Utilities;
|
using Bit.iOS.Autofill.Utilities;
|
||||||
|
using Bit.iOS.Core.Utilities;
|
||||||
|
|
||||||
namespace Bit.iOS.Autofill
|
namespace Bit.iOS.Autofill
|
||||||
{
|
{
|
||||||
|
@ -18,19 +19,16 @@ namespace Bit.iOS.Autofill
|
||||||
public Context Context { get; set; }
|
public Context Context { get; set; }
|
||||||
public CredentialProviderViewController CPViewController { get; set; }
|
public CredentialProviderViewController CPViewController { get; set; }
|
||||||
|
|
||||||
public override void ViewWillAppear(bool animated)
|
|
||||||
{
|
|
||||||
UINavigationBar.Appearance.ShadowImage = new UIImage();
|
|
||||||
UINavigationBar.Appearance.SetBackgroundImage(new UIImage(), UIBarMetrics.Default);
|
|
||||||
base.ViewWillAppear(animated);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async override void ViewDidLoad()
|
public async override void ViewDidLoad()
|
||||||
{
|
{
|
||||||
base.ViewDidLoad();
|
base.ViewDidLoad();
|
||||||
NavItem.Title = AppResources.SearchVault;
|
NavItem.Title = AppResources.SearchVault;
|
||||||
CancelBarButton.Title = AppResources.Cancel;
|
CancelBarButton.Title = AppResources.Cancel;
|
||||||
SearchBar.Placeholder = AppResources.Search;
|
SearchBar.Placeholder = AppResources.Search;
|
||||||
|
if(!ThemeHelpers.LightTheme)
|
||||||
|
{
|
||||||
|
SearchBar.BackgroundColor = SearchBar.BarTintColor = ThemeHelpers.BackgroundColor;
|
||||||
|
}
|
||||||
|
|
||||||
TableView.RowHeight = UITableView.AutomaticDimension;
|
TableView.RowHeight = UITableView.AutomaticDimension;
|
||||||
TableView.EstimatedRowHeight = 44;
|
TableView.EstimatedRowHeight = 44;
|
||||||
|
|
|
@ -8,30 +8,24 @@ namespace Bit.iOS.Autofill
|
||||||
{
|
{
|
||||||
public partial class SetupViewController : ExtendedUIViewController
|
public partial class SetupViewController : ExtendedUIViewController
|
||||||
{
|
{
|
||||||
public SetupViewController(IntPtr handle) : base(handle)
|
public SetupViewController(IntPtr handle)
|
||||||
|
: base(handle)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public CredentialProviderViewController CPViewController { get; set; }
|
public CredentialProviderViewController CPViewController { 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()
|
public override void ViewDidLoad()
|
||||||
{
|
{
|
||||||
View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f);
|
|
||||||
var descriptor = UIFontDescriptor.PreferredBody;
|
var descriptor = UIFontDescriptor.PreferredBody;
|
||||||
DescriptionLabel.Text = $@"{AppResources.AutofillSetup}
|
DescriptionLabel.Text = $@"{AppResources.AutofillSetup}
|
||||||
|
|
||||||
{AppResources.AutofillSetup2}";
|
{AppResources.AutofillSetup2}";
|
||||||
DescriptionLabel.Font = UIFont.FromDescriptor(descriptor, descriptor.PointSize);
|
DescriptionLabel.Font = UIFont.FromDescriptor(descriptor, descriptor.PointSize);
|
||||||
DescriptionLabel.TextColor = new UIColor(red: 0.47f, green: 0.47f, blue: 0.47f, alpha: 1.0f);
|
DescriptionLabel.TextColor = ThemeHelpers.MutedColor;
|
||||||
|
|
||||||
ActivatedLabel.Text = AppResources.AutofillActivated;
|
ActivatedLabel.Text = AppResources.AutofillActivated;
|
||||||
ActivatedLabel.Font = UIFont.FromDescriptor(descriptor, descriptor.PointSize * 1.3f);
|
ActivatedLabel.Font = UIFont.FromDescriptor(descriptor, descriptor.PointSize * 1.3f);
|
||||||
|
ActivatedLabel.TextColor = ThemeHelpers.SuccessColor;
|
||||||
|
|
||||||
BackButton.Title = AppResources.Back;
|
BackButton.Title = AppResources.Back;
|
||||||
base.ViewDidLoad();
|
base.ViewDidLoad();
|
||||||
|
|
27
src/iOS.Core/Controllers/ExtendedUITableViewCell.cs
Normal file
27
src/iOS.Core/Controllers/ExtendedUITableViewCell.cs
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
using Bit.iOS.Core.Utilities;
|
||||||
|
using UIKit;
|
||||||
|
|
||||||
|
namespace Bit.iOS.Core.Controllers
|
||||||
|
{
|
||||||
|
public class ExtendedUITableViewCell : UITableViewCell
|
||||||
|
{
|
||||||
|
public ExtendedUITableViewCell()
|
||||||
|
{
|
||||||
|
BackgroundColor = ThemeHelpers.BackgroundColor;
|
||||||
|
if(!ThemeHelpers.LightTheme)
|
||||||
|
{
|
||||||
|
SelectionStyle = UITableViewCellSelectionStyle.None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExtendedUITableViewCell(UITableViewCellStyle style, string reusedId)
|
||||||
|
: base(style, reusedId)
|
||||||
|
{
|
||||||
|
BackgroundColor = ThemeHelpers.BackgroundColor;
|
||||||
|
if(!ThemeHelpers.LightTheme)
|
||||||
|
{
|
||||||
|
SelectionStyle = UITableViewCellSelectionStyle.None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,3 +1,4 @@
|
||||||
|
using Bit.iOS.Core.Utilities;
|
||||||
using System;
|
using System;
|
||||||
using UIKit;
|
using UIKit;
|
||||||
|
|
||||||
|
@ -8,5 +9,36 @@ namespace Bit.iOS.Core.Controllers
|
||||||
public ExtendedUITableViewController(IntPtr handle)
|
public ExtendedUITableViewController(IntPtr handle)
|
||||||
: base(handle)
|
: base(handle)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
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()
|
||||||
|
{
|
||||||
|
base.ViewDidLoad();
|
||||||
|
if(View != null)
|
||||||
|
{
|
||||||
|
View.BackgroundColor = ThemeHelpers.BackgroundColor;
|
||||||
|
}
|
||||||
|
if(TableView != null)
|
||||||
|
{
|
||||||
|
TableView.BackgroundColor = ThemeHelpers.BackgroundColor;
|
||||||
|
TableView.SeparatorColor = ThemeHelpers.SeparatorColor;
|
||||||
|
}
|
||||||
|
if(NavigationController?.NavigationBar != null)
|
||||||
|
{
|
||||||
|
NavigationController.NavigationBar.BarTintColor = ThemeHelpers.NavBarBackgroundColor;
|
||||||
|
NavigationController.NavigationBar.BackgroundColor = ThemeHelpers.NavBarBackgroundColor;
|
||||||
|
NavigationController.NavigationBar.TintColor = ThemeHelpers.NavBarTextColor;
|
||||||
|
NavigationController.NavigationBar.TitleTextAttributes = new UIStringAttributes
|
||||||
|
{
|
||||||
|
ForegroundColor = ThemeHelpers.NavBarTextColor
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
25
src/iOS.Core/Controllers/ExtendedUITableViewSource.cs
Normal file
25
src/iOS.Core/Controllers/ExtendedUITableViewSource.cs
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
using Bit.iOS.Core.Utilities;
|
||||||
|
using System;
|
||||||
|
using UIKit;
|
||||||
|
|
||||||
|
namespace Bit.iOS.Core.Views
|
||||||
|
{
|
||||||
|
public abstract class ExtendedUITableViewSource : UITableViewSource
|
||||||
|
{
|
||||||
|
public override void WillDisplayHeaderView(UITableView tableView, UIView headerView, nint section)
|
||||||
|
{
|
||||||
|
if(headerView != null && headerView is UITableViewHeaderFooterView hv && hv.TextLabel != null)
|
||||||
|
{
|
||||||
|
hv.TextLabel.TextColor = ThemeHelpers.MutedColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void WillDisplayFooterView(UITableView tableView, UIView footerView, nint section)
|
||||||
|
{
|
||||||
|
if(footerView != null && footerView is UITableViewHeaderFooterView fv && fv.TextLabel != null)
|
||||||
|
{
|
||||||
|
fv.TextLabel.TextColor = ThemeHelpers.MutedColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,3 +1,4 @@
|
||||||
|
using Bit.iOS.Core.Utilities;
|
||||||
using System;
|
using System;
|
||||||
using UIKit;
|
using UIKit;
|
||||||
|
|
||||||
|
@ -8,5 +9,31 @@ namespace Bit.iOS.Core.Controllers
|
||||||
public ExtendedUIViewController(IntPtr handle)
|
public ExtendedUIViewController(IntPtr handle)
|
||||||
: base(handle)
|
: base(handle)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
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()
|
||||||
|
{
|
||||||
|
base.ViewDidLoad();
|
||||||
|
if(View != null)
|
||||||
|
{
|
||||||
|
View.BackgroundColor = ThemeHelpers.BackgroundColor;
|
||||||
|
}
|
||||||
|
if(NavigationController?.NavigationBar != null)
|
||||||
|
{
|
||||||
|
NavigationController.NavigationBar.BarTintColor = ThemeHelpers.NavBarBackgroundColor;
|
||||||
|
NavigationController.NavigationBar.BackgroundColor = ThemeHelpers.NavBarBackgroundColor;
|
||||||
|
NavigationController.NavigationBar.TintColor = ThemeHelpers.NavBarTextColor;
|
||||||
|
NavigationController.NavigationBar.TitleTextAttributes = new UIStringAttributes
|
||||||
|
{
|
||||||
|
ForegroundColor = ThemeHelpers.NavBarTextColor
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,13 +41,6 @@ namespace Bit.iOS.Core.Controllers
|
||||||
public FormEntryTableViewCell MasterPasswordCell { get; set; } = new FormEntryTableViewCell(
|
public FormEntryTableViewCell MasterPasswordCell { get; set; } = new FormEntryTableViewCell(
|
||||||
AppResources.MasterPassword);
|
AppResources.MasterPassword);
|
||||||
|
|
||||||
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()
|
public override void ViewDidLoad()
|
||||||
{
|
{
|
||||||
_lockService = ServiceContainer.Resolve<ILockService>("lockService");
|
_lockService = ServiceContainer.Resolve<ILockService>("lockService");
|
||||||
|
@ -66,7 +59,6 @@ namespace Bit.iOS.Core.Controllers
|
||||||
BaseNavItem.Title = _pinLock ? AppResources.VerifyPIN : AppResources.VerifyMasterPassword;
|
BaseNavItem.Title = _pinLock ? AppResources.VerifyPIN : AppResources.VerifyMasterPassword;
|
||||||
BaseCancelButton.Title = AppResources.Cancel;
|
BaseCancelButton.Title = AppResources.Cancel;
|
||||||
BaseSubmitButton.Title = AppResources.Submit;
|
BaseSubmitButton.Title = AppResources.Submit;
|
||||||
View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f);
|
|
||||||
|
|
||||||
var descriptor = UIFontDescriptor.PreferredBody;
|
var descriptor = UIFontDescriptor.PreferredBody;
|
||||||
|
|
||||||
|
@ -238,7 +230,7 @@ namespace Bit.iOS.Core.Controllers
|
||||||
PresentViewController(alert, true, null);
|
PresentViewController(alert, true, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TableSource : UITableViewSource
|
public class TableSource : ExtendedUITableViewSource
|
||||||
{
|
{
|
||||||
private LockPasswordViewController _controller;
|
private LockPasswordViewController _controller;
|
||||||
|
|
||||||
|
@ -260,13 +252,13 @@ namespace Bit.iOS.Core.Controllers
|
||||||
{
|
{
|
||||||
if(indexPath.Row == 0)
|
if(indexPath.Row == 0)
|
||||||
{
|
{
|
||||||
var cell = new UITableViewCell();
|
var cell = new ExtendedUITableViewCell();
|
||||||
cell.TextLabel.TextColor = new UIColor(red: 0.24f, green: 0.55f, blue: 0.74f, alpha: 1.0f);
|
cell.TextLabel.TextColor = ThemeHelpers.PrimaryColor;
|
||||||
cell.TextLabel.Text = AppResources.UseFingerprintToUnlock;
|
cell.TextLabel.Text = AppResources.UseFingerprintToUnlock;
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new UITableViewCell();
|
return new ExtendedUITableViewCell();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override nfloat GetHeightForRow(UITableView tableView, NSIndexPath indexPath)
|
public override nfloat GetHeightForRow(UITableView tableView, NSIndexPath indexPath)
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace Bit.iOS.Core.Controllers
|
||||||
public FormEntryTableViewCell NameCell { get; set; } = new FormEntryTableViewCell(AppResources.Name);
|
public FormEntryTableViewCell NameCell { get; set; } = new FormEntryTableViewCell(AppResources.Name);
|
||||||
public FormEntryTableViewCell UsernameCell { get; set; } = new FormEntryTableViewCell(AppResources.Username);
|
public FormEntryTableViewCell UsernameCell { get; set; } = new FormEntryTableViewCell(AppResources.Username);
|
||||||
public FormEntryTableViewCell PasswordCell { get; set; } = new FormEntryTableViewCell(AppResources.Password);
|
public FormEntryTableViewCell PasswordCell { get; set; } = new FormEntryTableViewCell(AppResources.Password);
|
||||||
public UITableViewCell GeneratePasswordCell { get; set; } = new UITableViewCell(
|
public UITableViewCell GeneratePasswordCell { get; set; } = new ExtendedUITableViewCell(
|
||||||
UITableViewCellStyle.Subtitle, "GeneratePasswordCell");
|
UITableViewCellStyle.Subtitle, "GeneratePasswordCell");
|
||||||
public FormEntryTableViewCell UriCell { get; set; } = new FormEntryTableViewCell(AppResources.URI);
|
public FormEntryTableViewCell UriCell { get; set; } = new FormEntryTableViewCell(AppResources.URI);
|
||||||
public SwitchTableViewCell FavoriteCell { get; set; } = new SwitchTableViewCell(AppResources.Favorite);
|
public SwitchTableViewCell FavoriteCell { get; set; } = new SwitchTableViewCell(AppResources.Favorite);
|
||||||
|
@ -43,13 +43,6 @@ namespace Bit.iOS.Core.Controllers
|
||||||
public abstract UIBarButtonItem BaseSaveButton { get; }
|
public abstract UIBarButtonItem BaseSaveButton { get; }
|
||||||
public abstract Action Success { get; }
|
public abstract Action Success { get; }
|
||||||
|
|
||||||
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()
|
public override void ViewDidLoad()
|
||||||
{
|
{
|
||||||
_cipherService = ServiceContainer.Resolve<ICipherService>("cipherService");
|
_cipherService = ServiceContainer.Resolve<ICipherService>("cipherService");
|
||||||
|
@ -58,7 +51,7 @@ namespace Bit.iOS.Core.Controllers
|
||||||
BaseNavItem.Title = AppResources.AddItem;
|
BaseNavItem.Title = AppResources.AddItem;
|
||||||
BaseCancelButton.Title = AppResources.Cancel;
|
BaseCancelButton.Title = AppResources.Cancel;
|
||||||
BaseSaveButton.Title = AppResources.Save;
|
BaseSaveButton.Title = AppResources.Save;
|
||||||
View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f);
|
View.BackgroundColor = ThemeHelpers.BackgroundColor;
|
||||||
|
|
||||||
NameCell.TextField.Text = Context?.Uri?.Host ?? string.Empty;
|
NameCell.TextField.Text = Context?.Uri?.Host ?? string.Empty;
|
||||||
NameCell.TextField.ReturnKeyType = UIReturnKeyType.Next;
|
NameCell.TextField.ReturnKeyType = UIReturnKeyType.Next;
|
||||||
|
@ -87,6 +80,8 @@ namespace Bit.iOS.Core.Controllers
|
||||||
};
|
};
|
||||||
|
|
||||||
GeneratePasswordCell.TextLabel.Text = AppResources.GeneratePassword;
|
GeneratePasswordCell.TextLabel.Text = AppResources.GeneratePassword;
|
||||||
|
GeneratePasswordCell.TextLabel.TextColor = GeneratePasswordCell.TextLabel.TintColor =
|
||||||
|
ThemeHelpers.TextColor;
|
||||||
GeneratePasswordCell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
|
GeneratePasswordCell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
|
||||||
|
|
||||||
UriCell.TextField.Text = Context?.UrlString ?? string.Empty;
|
UriCell.TextField.Text = Context?.UrlString ?? string.Empty;
|
||||||
|
@ -206,7 +201,7 @@ namespace Bit.iOS.Core.Controllers
|
||||||
AppResources.InternetConnectionRequiredMessage, AppResources.Ok);
|
AppResources.InternetConnectionRequiredMessage, AppResources.Ok);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TableSource : UITableViewSource
|
public class TableSource : ExtendedUITableViewSource
|
||||||
{
|
{
|
||||||
private LoginAddViewController _controller;
|
private LoginAddViewController _controller;
|
||||||
|
|
||||||
|
@ -256,7 +251,7 @@ namespace Bit.iOS.Core.Controllers
|
||||||
return _controller.NotesCell;
|
return _controller.NotesCell;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new UITableViewCell();
|
return new ExtendedUITableViewCell();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override nfloat GetHeightForRow(UITableView tableView, NSIndexPath indexPath)
|
public override nfloat GetHeightForRow(UITableView tableView, NSIndexPath indexPath)
|
||||||
|
|
|
@ -26,9 +26,12 @@ namespace Bit.iOS.Core.Controllers
|
||||||
public SwitchTableViewCell LowercaseCell { get; set; } = new SwitchTableViewCell("a-z");
|
public SwitchTableViewCell LowercaseCell { get; set; } = new SwitchTableViewCell("a-z");
|
||||||
public SwitchTableViewCell NumbersCell { get; set; } = new SwitchTableViewCell("0-9");
|
public SwitchTableViewCell NumbersCell { get; set; } = new SwitchTableViewCell("0-9");
|
||||||
public SwitchTableViewCell SpecialCell { get; set; } = new SwitchTableViewCell("!@#$%^&*");
|
public SwitchTableViewCell SpecialCell { get; set; } = new SwitchTableViewCell("!@#$%^&*");
|
||||||
public StepperTableViewCell MinNumbersCell { get; set; } = new StepperTableViewCell(AppResources.MinNumbers, 1, 0, 5, 1);
|
public StepperTableViewCell MinNumbersCell { get; set; } = new StepperTableViewCell(
|
||||||
public StepperTableViewCell MinSpecialCell { get; set; } = new StepperTableViewCell(AppResources.MinSpecial, 1, 0, 5, 1);
|
AppResources.MinNumbers, 1, 0, 5, 1);
|
||||||
public SliderTableViewCell LengthCell { get; set; } = new SliderTableViewCell(AppResources.Length, 10, 5, 64);
|
public StepperTableViewCell MinSpecialCell { get; set; } = new StepperTableViewCell(
|
||||||
|
AppResources.MinSpecial, 1, 0, 5, 1);
|
||||||
|
public SliderTableViewCell LengthCell { get; set; } = new SliderTableViewCell(
|
||||||
|
AppResources.Length, 10, 5, 64);
|
||||||
|
|
||||||
public PasswordGenerationOptions PasswordOptions { get; set; }
|
public PasswordGenerationOptions PasswordOptions { get; set; }
|
||||||
public abstract UINavigationItem BaseNavItem { get; }
|
public abstract UINavigationItem BaseNavItem { get; }
|
||||||
|
@ -36,13 +39,6 @@ namespace Bit.iOS.Core.Controllers
|
||||||
public abstract UIBarButtonItem BaseSelectBarButton { get; }
|
public abstract UIBarButtonItem BaseSelectBarButton { get; }
|
||||||
public abstract UILabel BasePasswordLabel { get; }
|
public abstract UILabel BasePasswordLabel { get; }
|
||||||
|
|
||||||
public override void ViewWillAppear(bool animated)
|
|
||||||
{
|
|
||||||
UINavigationBar.Appearance.ShadowImage = new UIImage();
|
|
||||||
UINavigationBar.Appearance.SetBackgroundImage(new UIImage(), UIBarMetrics.Default);
|
|
||||||
base.ViewWillAppear(animated);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async override void ViewDidLoad()
|
public async override void ViewDidLoad()
|
||||||
{
|
{
|
||||||
_passwordGenerationService = ServiceContainer.Resolve<IPasswordGenerationService>(
|
_passwordGenerationService = ServiceContainer.Resolve<IPasswordGenerationService>(
|
||||||
|
@ -51,13 +47,13 @@ namespace Bit.iOS.Core.Controllers
|
||||||
BaseNavItem.Title = AppResources.PasswordGenerator;
|
BaseNavItem.Title = AppResources.PasswordGenerator;
|
||||||
BaseCancelButton.Title = AppResources.Cancel;
|
BaseCancelButton.Title = AppResources.Cancel;
|
||||||
BaseSelectBarButton.Title = AppResources.Select;
|
BaseSelectBarButton.Title = AppResources.Select;
|
||||||
View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f);
|
|
||||||
|
|
||||||
var descriptor = UIFontDescriptor.PreferredBody;
|
var descriptor = UIFontDescriptor.PreferredBody;
|
||||||
BasePasswordLabel.Font = UIFont.FromName("Menlo-Regular", descriptor.PointSize * 1.3f);
|
BasePasswordLabel.Font = UIFont.FromName("Menlo-Regular", descriptor.PointSize * 1.3f);
|
||||||
BasePasswordLabel.LineBreakMode = UILineBreakMode.TailTruncation;
|
BasePasswordLabel.LineBreakMode = UILineBreakMode.TailTruncation;
|
||||||
BasePasswordLabel.Lines = 1;
|
BasePasswordLabel.Lines = 1;
|
||||||
BasePasswordLabel.AdjustsFontSizeToFitWidth = false;
|
BasePasswordLabel.AdjustsFontSizeToFitWidth = false;
|
||||||
|
BasePasswordLabel.TextColor = ThemeHelpers.TextColor;
|
||||||
|
|
||||||
var controller = ChildViewControllers.LastOrDefault();
|
var controller = ChildViewControllers.LastOrDefault();
|
||||||
if(controller != null)
|
if(controller != null)
|
||||||
|
@ -71,7 +67,8 @@ namespace Bit.iOS.Core.Controllers
|
||||||
OptionsTableViewController.TableView.EstimatedRowHeight = 70;
|
OptionsTableViewController.TableView.EstimatedRowHeight = 70;
|
||||||
OptionsTableViewController.TableView.Source = new TableSource(this);
|
OptionsTableViewController.TableView.Source = new TableSource(this);
|
||||||
OptionsTableViewController.TableView.AllowsSelection = true;
|
OptionsTableViewController.TableView.AllowsSelection = true;
|
||||||
OptionsTableViewController.View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f);
|
OptionsTableViewController.View.BackgroundColor = ThemeHelpers.BackgroundColor;
|
||||||
|
OptionsTableViewController.TableView.SeparatorColor = ThemeHelpers.SeparatorColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
var options = await _passwordGenerationService.GetOptionsAsync();
|
var options = await _passwordGenerationService.GetOptionsAsync();
|
||||||
|
@ -159,7 +156,8 @@ namespace Bit.iOS.Core.Controllers
|
||||||
|
|
||||||
private bool InvalidState()
|
private bool InvalidState()
|
||||||
{
|
{
|
||||||
return !LowercaseCell.Switch.On && !UppercaseCell.Switch.On && !NumbersCell.Switch.On && !SpecialCell.Switch.On;
|
return !LowercaseCell.Switch.On && !UppercaseCell.Switch.On && !NumbersCell.Switch.On &&
|
||||||
|
!SpecialCell.Switch.On;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task GeneratePasswordAsync()
|
private async Task GeneratePasswordAsync()
|
||||||
|
@ -177,7 +175,7 @@ namespace Bit.iOS.Core.Controllers
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TableSource : UITableViewSource
|
public class TableSource : ExtendedUITableViewSource
|
||||||
{
|
{
|
||||||
private PasswordGeneratorViewController _controller;
|
private PasswordGeneratorViewController _controller;
|
||||||
|
|
||||||
|
@ -190,8 +188,8 @@ namespace Bit.iOS.Core.Controllers
|
||||||
{
|
{
|
||||||
if(indexPath.Section == 0)
|
if(indexPath.Section == 0)
|
||||||
{
|
{
|
||||||
var cell = new UITableViewCell();
|
var cell = new ExtendedUITableViewCell();
|
||||||
cell.TextLabel.TextColor = new UIColor(red: 0.24f, green: 0.55f, blue: 0.74f, alpha: 1.0f);
|
cell.TextLabel.TextColor = ThemeHelpers.PrimaryColor;
|
||||||
if(indexPath.Row == 0)
|
if(indexPath.Row == 0)
|
||||||
{
|
{
|
||||||
cell.TextLabel.Text = AppResources.RegeneratePassword;
|
cell.TextLabel.Text = AppResources.RegeneratePassword;
|
||||||
|
@ -232,7 +230,7 @@ namespace Bit.iOS.Core.Controllers
|
||||||
return _controller.MinSpecialCell;
|
return _controller.MinSpecialCell;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new UITableViewCell();
|
return new ExtendedUITableViewCell();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override nfloat GetHeightForRow(UITableView tableView, NSIndexPath indexPath)
|
public override nfloat GetHeightForRow(UITableView tableView, NSIndexPath indexPath)
|
||||||
|
|
|
@ -9,6 +9,13 @@ namespace Bit.iOS.Core.Utilities
|
||||||
public static UIColor SplashBackgroundColor = Xamarin.Forms.Color.FromHex("#efeff4").ToUIColor();
|
public static UIColor SplashBackgroundColor = Xamarin.Forms.Color.FromHex("#efeff4").ToUIColor();
|
||||||
public static UIColor BackgroundColor = Xamarin.Forms.Color.FromHex("#ffffff").ToUIColor();
|
public static UIColor BackgroundColor = Xamarin.Forms.Color.FromHex("#ffffff").ToUIColor();
|
||||||
public static UIColor MutedColor = Xamarin.Forms.Color.FromHex("#777777").ToUIColor();
|
public static UIColor MutedColor = Xamarin.Forms.Color.FromHex("#777777").ToUIColor();
|
||||||
|
public static UIColor SuccessColor = Xamarin.Forms.Color.FromHex("#00a65a").ToUIColor();
|
||||||
|
public static UIColor PrimaryColor = Xamarin.Forms.Color.FromHex("#3c8dbc").ToUIColor();
|
||||||
|
public static UIColor TextColor = Xamarin.Forms.Color.FromHex("#000000").ToUIColor();
|
||||||
|
public static UIColor PlaceholderColor = Xamarin.Forms.Color.FromHex("#d0d0d0").ToUIColor();
|
||||||
|
public static UIColor SeparatorColor = Xamarin.Forms.Color.FromHex("#dddddd").ToUIColor();
|
||||||
|
public static UIColor NavBarBackgroundColor = Xamarin.Forms.Color.FromHex("#3c8dbc").ToUIColor();
|
||||||
|
public static UIColor NavBarTextColor = Xamarin.Forms.Color.FromHex("#ffffff").ToUIColor();
|
||||||
|
|
||||||
public static void SetAppearance(string theme)
|
public static void SetAppearance(string theme)
|
||||||
{
|
{
|
||||||
|
@ -24,6 +31,24 @@ namespace Bit.iOS.Core.Utilities
|
||||||
{
|
{
|
||||||
SetAppearance(theme);
|
SetAppearance(theme);
|
||||||
UIView.Appearance.BackgroundColor = BackgroundColor;
|
UIView.Appearance.BackgroundColor = BackgroundColor;
|
||||||
|
UILabel.Appearance.TextColor = TextColor;
|
||||||
|
UITextField.Appearance.TintColor = TextColor;
|
||||||
|
UITextView.Appearance.TintColor = TextColor;
|
||||||
|
UITextField.Appearance.BackgroundColor = BackgroundColor;
|
||||||
|
UITextView.Appearance.BackgroundColor = BackgroundColor;
|
||||||
|
UITableView.Appearance.BackgroundColor = BackgroundColor;
|
||||||
|
UITableView.Appearance.SeparatorColor = SeparatorColor;
|
||||||
|
UINavigationBar.Appearance.BackgroundColor = NavBarBackgroundColor;
|
||||||
|
UINavigationBar.Appearance.BarTintColor = NavBarBackgroundColor;
|
||||||
|
UINavigationBar.Appearance.TintColor = NavBarTextColor;
|
||||||
|
UINavigationBar.Appearance.Translucent = false;
|
||||||
|
UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes()
|
||||||
|
{
|
||||||
|
TextColor = NavBarTextColor
|
||||||
|
});
|
||||||
|
UIBarButtonItem.Appearance.TintColor = NavBarTextColor;
|
||||||
|
UIButton.Appearance.TintColor = TextColor;
|
||||||
|
UILabel.AppearanceWhenContainedIn(typeof(UITableViewHeaderFooterView)).TextColor = MutedColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SetThemeVariables(string theme)
|
private static void SetThemeVariables(string theme)
|
||||||
|
@ -31,21 +56,45 @@ namespace Bit.iOS.Core.Utilities
|
||||||
LightTheme = false;
|
LightTheme = false;
|
||||||
if(theme == "dark")
|
if(theme == "dark")
|
||||||
{
|
{
|
||||||
|
var whiteColor = Xamarin.Forms.Color.FromHex("#ffffff").ToUIColor();
|
||||||
MutedColor = Xamarin.Forms.Color.FromHex("#a3a3a3").ToUIColor();
|
MutedColor = Xamarin.Forms.Color.FromHex("#a3a3a3").ToUIColor();
|
||||||
|
SuccessColor = Xamarin.Forms.Color.FromHex("#00a65a").ToUIColor();
|
||||||
BackgroundColor = Xamarin.Forms.Color.FromHex("#303030").ToUIColor();
|
BackgroundColor = Xamarin.Forms.Color.FromHex("#303030").ToUIColor();
|
||||||
SplashBackgroundColor = Xamarin.Forms.Color.FromHex("#222222").ToUIColor();
|
SplashBackgroundColor = Xamarin.Forms.Color.FromHex("#222222").ToUIColor();
|
||||||
|
PrimaryColor = Xamarin.Forms.Color.FromHex("#52bdfb").ToUIColor();
|
||||||
|
TextColor = whiteColor;
|
||||||
|
PlaceholderColor = Xamarin.Forms.Color.FromHex("#707070").ToUIColor();
|
||||||
|
SeparatorColor = Xamarin.Forms.Color.FromHex("#191919").ToUIColor();
|
||||||
|
NavBarBackgroundColor = Xamarin.Forms.Color.FromHex("#212121").ToUIColor();
|
||||||
|
NavBarTextColor = whiteColor;
|
||||||
}
|
}
|
||||||
else if(theme == "black")
|
else if(theme == "black")
|
||||||
{
|
{
|
||||||
|
var blackColor = Xamarin.Forms.Color.FromHex("#000000").ToUIColor();
|
||||||
|
var whiteColor = Xamarin.Forms.Color.FromHex("#ffffff").ToUIColor();
|
||||||
MutedColor = Xamarin.Forms.Color.FromHex("#a3a3a3").ToUIColor();
|
MutedColor = Xamarin.Forms.Color.FromHex("#a3a3a3").ToUIColor();
|
||||||
BackgroundColor = Xamarin.Forms.Color.FromHex("#000000").ToUIColor();
|
SuccessColor = Xamarin.Forms.Color.FromHex("#00a65a").ToUIColor();
|
||||||
SplashBackgroundColor = BackgroundColor;
|
BackgroundColor = blackColor;
|
||||||
|
SplashBackgroundColor = blackColor;
|
||||||
|
PrimaryColor = Xamarin.Forms.Color.FromHex("#52bdfb").ToUIColor();
|
||||||
|
TextColor = whiteColor;
|
||||||
|
PlaceholderColor = Xamarin.Forms.Color.FromHex("#707070").ToUIColor();
|
||||||
|
SeparatorColor = Xamarin.Forms.Color.FromHex("#282828").ToUIColor();
|
||||||
|
NavBarBackgroundColor = blackColor;
|
||||||
|
NavBarTextColor = whiteColor;
|
||||||
}
|
}
|
||||||
else if(theme == "nord")
|
else if(theme == "nord")
|
||||||
{
|
{
|
||||||
MutedColor = Xamarin.Forms.Color.FromHex("#d8dee9").ToUIColor();
|
MutedColor = Xamarin.Forms.Color.FromHex("#d8dee9").ToUIColor();
|
||||||
|
SuccessColor = Xamarin.Forms.Color.FromHex("#a3be8c").ToUIColor();
|
||||||
BackgroundColor = Xamarin.Forms.Color.FromHex("#3b4252").ToUIColor();
|
BackgroundColor = Xamarin.Forms.Color.FromHex("#3b4252").ToUIColor();
|
||||||
SplashBackgroundColor = Xamarin.Forms.Color.FromHex("#2e3440").ToUIColor();
|
SplashBackgroundColor = Xamarin.Forms.Color.FromHex("#2e3440").ToUIColor();
|
||||||
|
PrimaryColor = Xamarin.Forms.Color.FromHex("#81a1c1").ToUIColor();
|
||||||
|
TextColor = Xamarin.Forms.Color.FromHex("#e5e9f0").ToUIColor();
|
||||||
|
PlaceholderColor = Xamarin.Forms.Color.FromHex("#7b88a1").ToUIColor();
|
||||||
|
SeparatorColor = Xamarin.Forms.Color.FromHex("#2e3440").ToUIColor();
|
||||||
|
NavBarBackgroundColor = Xamarin.Forms.Color.FromHex("#2e3440").ToUIColor();
|
||||||
|
NavBarTextColor = Xamarin.Forms.Color.FromHex("#e5e9f0").ToUIColor();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
using Bit.Core.Abstractions;
|
using Bit.Core.Abstractions;
|
||||||
using Bit.Core.Models.View;
|
using Bit.Core.Models.View;
|
||||||
using Bit.Core.Utilities;
|
using Bit.Core.Utilities;
|
||||||
|
using Bit.iOS.Core.Controllers;
|
||||||
using Bit.iOS.Core.Models;
|
using Bit.iOS.Core.Models;
|
||||||
|
using Bit.iOS.Core.Utilities;
|
||||||
using Foundation;
|
using Foundation;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -14,7 +16,7 @@ using UIKit;
|
||||||
|
|
||||||
namespace Bit.iOS.Core.Views
|
namespace Bit.iOS.Core.Views
|
||||||
{
|
{
|
||||||
public class ExtensionTableSource : UITableViewSource
|
public class ExtensionTableSource : ExtendedUITableViewSource
|
||||||
{
|
{
|
||||||
private const string CellIdentifier = "TableCell";
|
private const string CellIdentifier = "TableCell";
|
||||||
|
|
||||||
|
@ -95,11 +97,12 @@ namespace Bit.iOS.Core.Views
|
||||||
{
|
{
|
||||||
if(Items == null || Items.Count() == 0)
|
if(Items == null || Items.Count() == 0)
|
||||||
{
|
{
|
||||||
var noDataCell = new UITableViewCell(UITableViewCellStyle.Default, "NoDataCell");
|
var noDataCell = new ExtendedUITableViewCell(UITableViewCellStyle.Default, "NoDataCell");
|
||||||
noDataCell.TextLabel.Text = AppResources.NoItemsTap;
|
noDataCell.TextLabel.Text = AppResources.NoItemsTap;
|
||||||
noDataCell.TextLabel.TextAlignment = UITextAlignment.Center;
|
noDataCell.TextLabel.TextAlignment = UITextAlignment.Center;
|
||||||
noDataCell.TextLabel.LineBreakMode = UILineBreakMode.WordWrap;
|
noDataCell.TextLabel.LineBreakMode = UILineBreakMode.WordWrap;
|
||||||
noDataCell.TextLabel.Lines = 0;
|
noDataCell.TextLabel.Lines = 0;
|
||||||
|
noDataCell.TextLabel.TextColor = ThemeHelpers.TextColor;
|
||||||
return noDataCell;
|
return noDataCell;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,9 +112,9 @@ namespace Bit.iOS.Core.Views
|
||||||
if(cell == null)
|
if(cell == null)
|
||||||
{
|
{
|
||||||
Debug.WriteLine("BW Log, Make new cell for list.");
|
Debug.WriteLine("BW Log, Make new cell for list.");
|
||||||
cell = new UITableViewCell(UITableViewCellStyle.Subtitle, CellIdentifier);
|
cell = new ExtendedUITableViewCell(UITableViewCellStyle.Subtitle, CellIdentifier);
|
||||||
cell.DetailTextLabel.TextColor = cell.DetailTextLabel.TintColor =
|
cell.TextLabel.TextColor = cell.TextLabel.TintColor = ThemeHelpers.TextColor;
|
||||||
new UIColor(red: 0.47f, green: 0.47f, blue: 0.47f, alpha: 1.0f);
|
cell.DetailTextLabel.TextColor = cell.DetailTextLabel.TintColor = ThemeHelpers.MutedColor;
|
||||||
}
|
}
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
using System;
|
using Bit.iOS.Core.Controllers;
|
||||||
|
using Bit.iOS.Core.Utilities;
|
||||||
|
using System;
|
||||||
using UIKit;
|
using UIKit;
|
||||||
|
|
||||||
namespace Bit.iOS.Core.Views
|
namespace Bit.iOS.Core.Views
|
||||||
{
|
{
|
||||||
public class FormEntryTableViewCell : UITableViewCell, ISelectable
|
public class FormEntryTableViewCell : ExtendedUITableViewCell, ISelectable
|
||||||
{
|
{
|
||||||
public FormEntryTableViewCell(
|
public FormEntryTableViewCell(
|
||||||
string labelName = null,
|
string labelName = null,
|
||||||
|
@ -22,7 +24,7 @@ namespace Bit.iOS.Core.Views
|
||||||
Text = labelName,
|
Text = labelName,
|
||||||
TranslatesAutoresizingMaskIntoConstraints = false,
|
TranslatesAutoresizingMaskIntoConstraints = false,
|
||||||
Font = UIFont.FromDescriptor(descriptor, 0.8f * pointSize),
|
Font = UIFont.FromDescriptor(descriptor, 0.8f * pointSize),
|
||||||
TextColor = new UIColor(red: 0.47f, green: 0.47f, blue: 0.47f, alpha: 1.0f)
|
TextColor = ThemeHelpers.MutedColor
|
||||||
};
|
};
|
||||||
|
|
||||||
ContentView.Add(Label);
|
ContentView.Add(Label);
|
||||||
|
@ -33,7 +35,10 @@ namespace Bit.iOS.Core.Views
|
||||||
TextView = new UITextView
|
TextView = new UITextView
|
||||||
{
|
{
|
||||||
TranslatesAutoresizingMaskIntoConstraints = false,
|
TranslatesAutoresizingMaskIntoConstraints = false,
|
||||||
Font = UIFont.FromDescriptor(descriptor, pointSize)
|
Font = UIFont.FromDescriptor(descriptor, pointSize),
|
||||||
|
TextColor = ThemeHelpers.TextColor,
|
||||||
|
TintColor = ThemeHelpers.TextColor,
|
||||||
|
BackgroundColor = ThemeHelpers.BackgroundColor
|
||||||
};
|
};
|
||||||
|
|
||||||
ContentView.Add(TextView);
|
ContentView.Add(TextView);
|
||||||
|
@ -67,7 +72,10 @@ namespace Bit.iOS.Core.Views
|
||||||
TranslatesAutoresizingMaskIntoConstraints = false,
|
TranslatesAutoresizingMaskIntoConstraints = false,
|
||||||
BorderStyle = UITextBorderStyle.None,
|
BorderStyle = UITextBorderStyle.None,
|
||||||
Font = UIFont.FromDescriptor(descriptor, pointSize),
|
Font = UIFont.FromDescriptor(descriptor, pointSize),
|
||||||
ClearButtonMode = UITextFieldViewMode.WhileEditing
|
ClearButtonMode = UITextFieldViewMode.WhileEditing,
|
||||||
|
TextColor = ThemeHelpers.TextColor,
|
||||||
|
TintColor = ThemeHelpers.TextColor,
|
||||||
|
BackgroundColor = ThemeHelpers.BackgroundColor
|
||||||
};
|
};
|
||||||
|
|
||||||
if(useLabelAsPlaceholder)
|
if(useLabelAsPlaceholder)
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
using CoreGraphics;
|
using Bit.iOS.Core.Controllers;
|
||||||
|
using Bit.iOS.Core.Utilities;
|
||||||
|
using CoreGraphics;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
@ -6,7 +8,7 @@ using UIKit;
|
||||||
|
|
||||||
namespace Bit.iOS.Core.Views
|
namespace Bit.iOS.Core.Views
|
||||||
{
|
{
|
||||||
public class PickerTableViewCell : UITableViewCell, ISelectable
|
public class PickerTableViewCell : ExtendedUITableViewCell, ISelectable
|
||||||
{
|
{
|
||||||
private List<string> _items = new List<string>();
|
private List<string> _items = new List<string>();
|
||||||
private int _selectedIndex = 0;
|
private int _selectedIndex = 0;
|
||||||
|
@ -24,7 +26,7 @@ namespace Bit.iOS.Core.Views
|
||||||
Text = labelName,
|
Text = labelName,
|
||||||
TranslatesAutoresizingMaskIntoConstraints = false,
|
TranslatesAutoresizingMaskIntoConstraints = false,
|
||||||
Font = UIFont.FromDescriptor(descriptor, 0.8f * pointSize),
|
Font = UIFont.FromDescriptor(descriptor, 0.8f * pointSize),
|
||||||
TextColor = new UIColor(red: 0.47f, green: 0.47f, blue: 0.47f, alpha: 1.0f)
|
TextColor = ThemeHelpers.MutedColor
|
||||||
};
|
};
|
||||||
|
|
||||||
ContentView.Add(Label);
|
ContentView.Add(Label);
|
||||||
|
@ -33,7 +35,10 @@ namespace Bit.iOS.Core.Views
|
||||||
{
|
{
|
||||||
BorderStyle = UITextBorderStyle.None,
|
BorderStyle = UITextBorderStyle.None,
|
||||||
TranslatesAutoresizingMaskIntoConstraints = false,
|
TranslatesAutoresizingMaskIntoConstraints = false,
|
||||||
Font = UIFont.FromDescriptor(descriptor, pointSize)
|
Font = UIFont.FromDescriptor(descriptor, pointSize),
|
||||||
|
TextColor = ThemeHelpers.TextColor,
|
||||||
|
TintColor = ThemeHelpers.TextColor,
|
||||||
|
BackgroundColor = ThemeHelpers.BackgroundColor
|
||||||
};
|
};
|
||||||
|
|
||||||
var width = (float)UIScreen.MainScreen.Bounds.Width;
|
var width = (float)UIScreen.MainScreen.Bounds.Width;
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
using System;
|
using Bit.iOS.Core.Controllers;
|
||||||
|
using Bit.iOS.Core.Utilities;
|
||||||
|
using System;
|
||||||
using UIKit;
|
using UIKit;
|
||||||
|
|
||||||
namespace Bit.iOS.Core.Views
|
namespace Bit.iOS.Core.Views
|
||||||
{
|
{
|
||||||
public class SliderTableViewCell : UITableViewCell
|
public class SliderTableViewCell : ExtendedUITableViewCell
|
||||||
{
|
{
|
||||||
private string _detailRightSpace = "\t";
|
private string _detailRightSpace = "\t";
|
||||||
private int _value;
|
private int _value;
|
||||||
|
@ -12,14 +14,16 @@ namespace Bit.iOS.Core.Views
|
||||||
: base(UITableViewCellStyle.Value1, nameof(SwitchTableViewCell))
|
: base(UITableViewCellStyle.Value1, nameof(SwitchTableViewCell))
|
||||||
{
|
{
|
||||||
TextLabel.Text = labelName;
|
TextLabel.Text = labelName;
|
||||||
DetailTextLabel.TextColor = new UIColor(red: 0.47f, green: 0.47f, blue: 0.47f, alpha: 1.0f);
|
TextLabel.TextColor = ThemeHelpers.TextColor;
|
||||||
|
DetailTextLabel.TextColor = ThemeHelpers.MutedColor;
|
||||||
|
|
||||||
Slider = new UISlider
|
Slider = new UISlider
|
||||||
{
|
{
|
||||||
MinValue = min,
|
MinValue = min,
|
||||||
MaxValue = max,
|
MaxValue = max,
|
||||||
TintColor = new UIColor(red: 0.24f, green: 0.55f, blue: 0.74f, alpha: 1.0f),
|
TintColor = ThemeHelpers.PrimaryColor,
|
||||||
Frame = new CoreGraphics.CGRect(0, 0, 180, 30)
|
Frame = new CoreGraphics.CGRect(0, 0, 180, 30),
|
||||||
|
BackgroundColor = ThemeHelpers.BackgroundColor
|
||||||
};
|
};
|
||||||
Slider.ValueChanged += Slider_ValueChanged;
|
Slider.ValueChanged += Slider_ValueChanged;
|
||||||
Value = value;
|
Value = value;
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
using System;
|
using Bit.iOS.Core.Controllers;
|
||||||
|
using Bit.iOS.Core.Utilities;
|
||||||
|
using System;
|
||||||
using UIKit;
|
using UIKit;
|
||||||
|
|
||||||
namespace Bit.iOS.Core.Views
|
namespace Bit.iOS.Core.Views
|
||||||
{
|
{
|
||||||
public class StepperTableViewCell : UITableViewCell
|
public class StepperTableViewCell : ExtendedUITableViewCell
|
||||||
{
|
{
|
||||||
// Give some space to the right of the detail in between the spacer.
|
// Give some space to the right of the detail in between the spacer.
|
||||||
// This is a bit of a hack, but I did not see a way to specify a margin on the
|
// This is a bit of a hack, but I did not see a way to specify a margin on the
|
||||||
|
@ -15,11 +17,12 @@ namespace Bit.iOS.Core.Views
|
||||||
: base(UITableViewCellStyle.Value1, nameof(SwitchTableViewCell))
|
: base(UITableViewCellStyle.Value1, nameof(SwitchTableViewCell))
|
||||||
{
|
{
|
||||||
TextLabel.Text = labelName;
|
TextLabel.Text = labelName;
|
||||||
DetailTextLabel.TextColor = new UIColor(red: 0.47f, green: 0.47f, blue: 0.47f, alpha: 1.0f);
|
TextLabel.TextColor = ThemeHelpers.TextColor;
|
||||||
|
DetailTextLabel.TextColor = ThemeHelpers.MutedColor;
|
||||||
|
|
||||||
Stepper = new UIStepper
|
Stepper = new UIStepper
|
||||||
{
|
{
|
||||||
TintColor = new UIColor(red: 0.47f, green: 0.47f, blue: 0.47f, alpha: 1.0f),
|
TintColor = ThemeHelpers.MutedColor,
|
||||||
MinimumValue = min,
|
MinimumValue = min,
|
||||||
MaximumValue = max
|
MaximumValue = max
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,14 +1,19 @@
|
||||||
using System;
|
using Bit.iOS.Core.Controllers;
|
||||||
|
using Bit.iOS.Core.Utilities;
|
||||||
|
using System;
|
||||||
using UIKit;
|
using UIKit;
|
||||||
|
|
||||||
namespace Bit.iOS.Core.Views
|
namespace Bit.iOS.Core.Views
|
||||||
{
|
{
|
||||||
public class SwitchTableViewCell : UITableViewCell
|
public class SwitchTableViewCell : ExtendedUITableViewCell
|
||||||
{
|
{
|
||||||
public SwitchTableViewCell(string labelName)
|
public SwitchTableViewCell(string labelName)
|
||||||
: base(UITableViewCellStyle.Default, nameof(SwitchTableViewCell))
|
: base(UITableViewCellStyle.Default, nameof(SwitchTableViewCell))
|
||||||
{
|
{
|
||||||
TextLabel.Text = labelName;
|
TextLabel.Text = labelName;
|
||||||
|
TextLabel.TextColor = ThemeHelpers.TextColor;
|
||||||
|
Switch.TintColor = ThemeHelpers.MutedColor;
|
||||||
|
Switch.OnTintColor = ThemeHelpers.PrimaryColor;
|
||||||
AccessoryView = Switch;
|
AccessoryView = Switch;
|
||||||
|
|
||||||
Switch.ValueChanged += Switch_ValueChanged;
|
Switch.ValueChanged += Switch_ValueChanged;
|
||||||
|
|
|
@ -55,7 +55,9 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Constants.cs" />
|
<Compile Include="Constants.cs" />
|
||||||
<Compile Include="Controllers\ExtendedUITableViewController.cs" />
|
<Compile Include="Controllers\ExtendedUITableViewController.cs" />
|
||||||
|
<Compile Include="Controllers\ExtendedUITableViewCell.cs" />
|
||||||
<Compile Include="Controllers\ExtendedUIViewController.cs" />
|
<Compile Include="Controllers\ExtendedUIViewController.cs" />
|
||||||
|
<Compile Include="Controllers\ExtendedUITableViewSource.cs" />
|
||||||
<Compile Include="Controllers\LockPasswordViewController.cs" />
|
<Compile Include="Controllers\LockPasswordViewController.cs" />
|
||||||
<Compile Include="Controllers\LoginAddViewController.cs" />
|
<Compile Include="Controllers\LoginAddViewController.cs" />
|
||||||
<Compile Include="Controllers\PasswordGeneratorViewController.cs" />
|
<Compile Include="Controllers\PasswordGeneratorViewController.cs" />
|
||||||
|
|
|
@ -378,6 +378,7 @@ namespace Bit.iOS.Extension
|
||||||
|
|
||||||
private void InitApp()
|
private void InitApp()
|
||||||
{
|
{
|
||||||
|
iOSCoreHelpers.AppearanceAdjustments();
|
||||||
if(ServiceContainer.RegisteredServices.Count > 0)
|
if(ServiceContainer.RegisteredServices.Count > 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -386,7 +387,6 @@ namespace Bit.iOS.Extension
|
||||||
ServiceContainer.Init();
|
ServiceContainer.Init();
|
||||||
iOSCoreHelpers.RegisterHockeyApp();
|
iOSCoreHelpers.RegisterHockeyApp();
|
||||||
iOSCoreHelpers.Bootstrap();
|
iOSCoreHelpers.Bootstrap();
|
||||||
iOSCoreHelpers.AppearanceAdjustments();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool IsLocked()
|
private bool IsLocked()
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
using Bit.iOS.Core.Utilities;
|
||||||
using System;
|
using System;
|
||||||
using UIKit;
|
using UIKit;
|
||||||
|
|
||||||
|
@ -16,6 +17,13 @@ namespace Bit.iOS.Extension
|
||||||
public override Action Success => () => LoadingController.DismissLockAndContinue();
|
public override Action Success => () => LoadingController.DismissLockAndContinue();
|
||||||
public override Action Cancel => () => LoadingController.CompleteRequest(null);
|
public override Action Cancel => () => LoadingController.CompleteRequest(null);
|
||||||
|
|
||||||
|
public override void ViewDidLoad()
|
||||||
|
{
|
||||||
|
base.ViewDidLoad();
|
||||||
|
CancelButton.TintColor = ThemeHelpers.NavBarTextColor;
|
||||||
|
SubmitButton.TintColor = ThemeHelpers.NavBarTextColor;
|
||||||
|
}
|
||||||
|
|
||||||
partial void SubmitButton_Activated(UIBarButtonItem sender)
|
partial void SubmitButton_Activated(UIBarButtonItem sender)
|
||||||
{
|
{
|
||||||
var task = CheckPasswordAsync();
|
var task = CheckPasswordAsync();
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using Bit.iOS.Core.Utilities;
|
||||||
using Foundation;
|
using Foundation;
|
||||||
using UIKit;
|
using UIKit;
|
||||||
|
|
||||||
|
@ -17,6 +18,13 @@ namespace Bit.iOS.Extension
|
||||||
public override UIBarButtonItem BaseCancelButton => CancelBarButton;
|
public override UIBarButtonItem BaseCancelButton => CancelBarButton;
|
||||||
public override UIBarButtonItem BaseSaveButton => SaveBarButton;
|
public override UIBarButtonItem BaseSaveButton => SaveBarButton;
|
||||||
|
|
||||||
|
public override void ViewDidLoad()
|
||||||
|
{
|
||||||
|
base.ViewDidLoad();
|
||||||
|
SaveBarButton.TintColor = ThemeHelpers.NavBarTextColor;
|
||||||
|
CancelBarButton.TintColor = ThemeHelpers.NavBarTextColor;
|
||||||
|
}
|
||||||
|
|
||||||
public override Action Success => () =>
|
public override Action Success => () =>
|
||||||
{
|
{
|
||||||
if(LoginListController != null)
|
if(LoginListController != null)
|
||||||
|
|
|
@ -23,16 +23,11 @@ namespace Bit.iOS.Extension
|
||||||
public Context Context { get; set; }
|
public Context Context { get; set; }
|
||||||
public LoadingViewController LoadingController { get; set; }
|
public LoadingViewController LoadingController { get; set; }
|
||||||
|
|
||||||
public override void ViewWillAppear(bool animated)
|
|
||||||
{
|
|
||||||
UINavigationBar.Appearance.ShadowImage = new UIImage();
|
|
||||||
UINavigationBar.Appearance.SetBackgroundImage(new UIImage(), UIBarMetrics.Default);
|
|
||||||
base.ViewWillAppear(animated);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async override void ViewDidLoad()
|
public async override void ViewDidLoad()
|
||||||
{
|
{
|
||||||
base.ViewDidLoad();
|
base.ViewDidLoad();
|
||||||
|
AddBarButton.TintColor = ThemeHelpers.NavBarTextColor;
|
||||||
|
CancelBarButton.TintColor = ThemeHelpers.NavBarTextColor;
|
||||||
NavItem.Title = AppResources.Items;
|
NavItem.Title = AppResources.Items;
|
||||||
if(!CanAutoFill())
|
if(!CanAutoFill())
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
<rect key="frame" x="66" y="316" width="282" height="44"/>
|
<rect key="frame" x="66" y="316" width="282" height="44"/>
|
||||||
</imageView>
|
</imageView>
|
||||||
</subviews>
|
</subviews>
|
||||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstItem="1713" firstAttribute="centerY" secondItem="44" secondAttribute="centerY" constant="-30" id="1763"/>
|
<constraint firstItem="1713" firstAttribute="centerY" secondItem="44" secondAttribute="centerY" constant="-30" id="1763"/>
|
||||||
<constraint firstItem="1713" firstAttribute="centerX" secondItem="44" secondAttribute="centerX" id="1764"/>
|
<constraint firstItem="1713" firstAttribute="centerX" secondItem="44" secondAttribute="centerX" id="1764"/>
|
||||||
|
@ -63,11 +62,6 @@
|
||||||
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="8A5-AR-QHS">
|
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="8A5-AR-QHS">
|
||||||
<rect key="frame" x="0.0" y="20" width="414" height="50"/>
|
<rect key="frame" x="0.0" y="20" width="414" height="50"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<color key="tintColor" red="0.0" green="0.52549019607843139" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<color key="barTintColor" red="0.23529411764705882" green="0.55294117647058827" blue="0.73725490196078436" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<textAttributes key="titleTextAttributes">
|
|
||||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
|
||||||
</textAttributes>
|
|
||||||
</navigationBar>
|
</navigationBar>
|
||||||
<nil name="viewControllers"/>
|
<nil name="viewControllers"/>
|
||||||
<connections>
|
<connections>
|
||||||
|
@ -85,10 +79,6 @@
|
||||||
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="1848">
|
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="1848">
|
||||||
<rect key="frame" x="0.0" y="20" width="414" height="50"/>
|
<rect key="frame" x="0.0" y="20" width="414" height="50"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||||
<color key="barTintColor" red="0.23529411764705882" green="0.55294117647058827" blue="0.73725490196078436" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<textAttributes key="titleTextAttributes">
|
|
||||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
|
||||||
</textAttributes>
|
|
||||||
</navigationBar>
|
</navigationBar>
|
||||||
<connections>
|
<connections>
|
||||||
<segue destination="2087" kind="relationship" relationship="rootViewController" id="2253"/>
|
<segue destination="2087" kind="relationship" relationship="rootViewController" id="2253"/>
|
||||||
|
@ -105,8 +95,6 @@
|
||||||
<tableView key="view" opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" allowsSelection="NO" rowHeight="50" sectionHeaderHeight="22" sectionFooterHeight="22" id="2088">
|
<tableView key="view" opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" allowsSelection="NO" rowHeight="50" sectionHeaderHeight="22" sectionFooterHeight="22" id="2088">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
|
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<color key="sectionIndexBackgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<sections/>
|
<sections/>
|
||||||
<connections>
|
<connections>
|
||||||
<outlet property="dataSource" destination="2087" id="2089"/>
|
<outlet property="dataSource" destination="2087" id="2089"/>
|
||||||
|
@ -115,13 +103,11 @@
|
||||||
</tableView>
|
</tableView>
|
||||||
<navigationItem key="navigationItem" title="Add Login" id="2252">
|
<navigationItem key="navigationItem" title="Add Login" id="2252">
|
||||||
<barButtonItem key="leftBarButtonItem" title="Cancel" id="3747">
|
<barButtonItem key="leftBarButtonItem" title="Cancel" id="3747">
|
||||||
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="CancelBarButton_Activated:" destination="2087" id="3751"/>
|
<action selector="CancelBarButton_Activated:" destination="2087" id="3751"/>
|
||||||
</connections>
|
</connections>
|
||||||
</barButtonItem>
|
</barButtonItem>
|
||||||
<barButtonItem key="rightBarButtonItem" title="Save" id="3748">
|
<barButtonItem key="rightBarButtonItem" title="Save" id="3748">
|
||||||
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="SaveBarButton_Activated:" destination="2087" id="3752"/>
|
<action selector="SaveBarButton_Activated:" destination="2087" id="3752"/>
|
||||||
</connections>
|
</connections>
|
||||||
|
@ -145,7 +131,6 @@
|
||||||
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="2305">
|
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="2305">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
|
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<prototypes>
|
<prototypes>
|
||||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" textLabel="3763" detailTextLabel="3764" rowHeight="44" style="IBUITableViewCellStyleSubtitle" id="3761">
|
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" textLabel="3763" detailTextLabel="3764" rowHeight="44" style="IBUITableViewCellStyleSubtitle" id="3761">
|
||||||
<rect key="frame" x="0.0" y="22" width="414" height="44"/>
|
<rect key="frame" x="0.0" y="22" width="414" height="44"/>
|
||||||
|
@ -158,14 +143,12 @@
|
||||||
<rect key="frame" x="20" y="4" width="35" height="21.5"/>
|
<rect key="frame" x="20" y="4" width="35" height="21.5"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="18"/>
|
<fontDescription key="fontDescription" type="system" pointSize="18"/>
|
||||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Subtitle" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="3764">
|
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Subtitle" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="3764">
|
||||||
<rect key="frame" x="20" y="25.5" width="44" height="14.5"/>
|
<rect key="frame" x="20" y="25.5" width="44" height="14.5"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
</subviews>
|
</subviews>
|
||||||
|
@ -180,13 +163,11 @@
|
||||||
<toolbarItems/>
|
<toolbarItems/>
|
||||||
<navigationItem key="navigationItem" title="Logins" id="3734">
|
<navigationItem key="navigationItem" title="Logins" id="3734">
|
||||||
<barButtonItem key="leftBarButtonItem" title="Cancel" id="3735">
|
<barButtonItem key="leftBarButtonItem" title="Cancel" id="3735">
|
||||||
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="CancelBarButton_Activated:" destination="2304" id="3750"/>
|
<action selector="CancelBarButton_Activated:" destination="2304" id="3750"/>
|
||||||
</connections>
|
</connections>
|
||||||
</barButtonItem>
|
</barButtonItem>
|
||||||
<barButtonItem key="rightBarButtonItem" systemItem="add" id="3736">
|
<barButtonItem key="rightBarButtonItem" systemItem="add" id="3736">
|
||||||
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="AddBarButton_Activated:" destination="2304" id="3749"/>
|
<action selector="AddBarButton_Activated:" destination="2304" id="3749"/>
|
||||||
</connections>
|
</connections>
|
||||||
|
@ -211,11 +192,6 @@
|
||||||
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="4577">
|
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="4577">
|
||||||
<rect key="frame" x="0.0" y="20" width="414" height="50"/>
|
<rect key="frame" x="0.0" y="20" width="414" height="50"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||||
<color key="tintColor" red="0.0" green="0.52549019607843139" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<color key="barTintColor" red="0.23529411764705882" green="0.55294117647058827" blue="0.73725490196078436" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<textAttributes key="titleTextAttributes">
|
|
||||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
|
||||||
</textAttributes>
|
|
||||||
</navigationBar>
|
</navigationBar>
|
||||||
<connections>
|
<connections>
|
||||||
<segue destination="4576" kind="relationship" relationship="rootViewController" id="4575"/>
|
<segue destination="4576" kind="relationship" relationship="rootViewController" id="4575"/>
|
||||||
|
@ -239,16 +215,13 @@
|
||||||
<subviews>
|
<subviews>
|
||||||
<containerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4933">
|
<containerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4933">
|
||||||
<rect key="frame" x="0.0" y="160.5" width="414" height="575.5"/>
|
<rect key="frame" x="0.0" y="160.5" width="414" height="575.5"/>
|
||||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<connections>
|
<connections>
|
||||||
<segue destination="4912" kind="embed" id="6480"/>
|
<segue destination="4912" kind="embed" id="6480"/>
|
||||||
</connections>
|
</connections>
|
||||||
</containerView>
|
</containerView>
|
||||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Label" textAlignment="center" lineBreakMode="tailTruncation" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="4940">
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Label" textAlignment="center" lineBreakMode="tailTruncation" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="4940">
|
||||||
<rect key="frame" x="15" y="105" width="384" height="20.5"/>
|
<rect key="frame" x="15" y="105" width="384" height="20.5"/>
|
||||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
</subviews>
|
</subviews>
|
||||||
|
@ -264,13 +237,11 @@
|
||||||
</view>
|
</view>
|
||||||
<navigationItem key="navigationItem" title="Generate Password" id="4580">
|
<navigationItem key="navigationItem" title="Generate Password" id="4580">
|
||||||
<barButtonItem key="leftBarButtonItem" title="Cancel" id="4807">
|
<barButtonItem key="leftBarButtonItem" title="Cancel" id="4807">
|
||||||
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="CancelBarButton_Activated:" destination="4576" id="4887"/>
|
<action selector="CancelBarButton_Activated:" destination="4576" id="4887"/>
|
||||||
</connections>
|
</connections>
|
||||||
</barButtonItem>
|
</barButtonItem>
|
||||||
<barButtonItem key="rightBarButtonItem" title="Select" id="4808">
|
<barButtonItem key="rightBarButtonItem" title="Select" id="4808">
|
||||||
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="SelectBarButton_Activated:" destination="4576" id="4810"/>
|
<action selector="SelectBarButton_Activated:" destination="4576" id="4810"/>
|
||||||
</connections>
|
</connections>
|
||||||
|
@ -296,7 +267,6 @@
|
||||||
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="4913">
|
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="4913">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="414" height="575.5"/>
|
<rect key="frame" x="0.0" y="0.0" width="414" height="575.5"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<connections>
|
<connections>
|
||||||
<outlet property="dataSource" destination="4912" id="4914"/>
|
<outlet property="dataSource" destination="4912" id="4914"/>
|
||||||
<outlet property="delegate" destination="4912" id="4915"/>
|
<outlet property="delegate" destination="4912" id="4915"/>
|
||||||
|
@ -318,11 +288,6 @@
|
||||||
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="6857">
|
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="6857">
|
||||||
<rect key="frame" x="0.0" y="20" width="414" height="50"/>
|
<rect key="frame" x="0.0" y="20" width="414" height="50"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||||
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<color key="barTintColor" red="0.23529411764705882" green="0.55294117647058827" blue="0.73725490196078436" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<textAttributes key="titleTextAttributes">
|
|
||||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
|
||||||
</textAttributes>
|
|
||||||
</navigationBar>
|
</navigationBar>
|
||||||
<connections>
|
<connections>
|
||||||
<segue destination="7413" kind="relationship" relationship="rootViewController" id="8266"/>
|
<segue destination="7413" kind="relationship" relationship="rootViewController" id="8266"/>
|
||||||
|
@ -339,7 +304,6 @@
|
||||||
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="7414">
|
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="7414">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
|
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<connections>
|
<connections>
|
||||||
<outlet property="dataSource" destination="7413" id="7415"/>
|
<outlet property="dataSource" destination="7413" id="7415"/>
|
||||||
<outlet property="delegate" destination="7413" id="7416"/>
|
<outlet property="delegate" destination="7413" id="7416"/>
|
||||||
|
@ -382,23 +346,18 @@
|
||||||
<subviews>
|
<subviews>
|
||||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Extension Activated!" textAlignment="center" lineBreakMode="tailTruncation" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="11092">
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Extension Activated!" textAlignment="center" lineBreakMode="tailTruncation" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="11092">
|
||||||
<rect key="frame" x="15" y="100" width="384" height="20.5"/>
|
<rect key="frame" x="15" y="100" width="384" height="20.5"/>
|
||||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" misplaced="YES" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="0" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="11093">
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" misplaced="YES" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="0" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="11093">
|
||||||
<rect key="frame" x="15" y="134.5" width="570" height="41"/>
|
<rect key="frame" x="15" y="134.5" width="570" height="41"/>
|
||||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" misplaced="YES" image="ext-icon.png" translatesAutoresizingMaskIntoConstraints="NO" id="11094">
|
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" misplaced="YES" image="ext-icon.png" translatesAutoresizingMaskIntoConstraints="NO" id="11094">
|
||||||
<rect key="frame" x="255" y="205.5" width="90" height="90"/>
|
<rect key="frame" x="255" y="205.5" width="90" height="90"/>
|
||||||
</imageView>
|
</imageView>
|
||||||
</subviews>
|
</subviews>
|
||||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstItem="11092" firstAttribute="leading" secondItem="10575" secondAttribute="leading" constant="15" id="11114"/>
|
<constraint firstItem="11092" firstAttribute="leading" secondItem="10575" secondAttribute="leading" constant="15" id="11114"/>
|
||||||
<constraint firstAttribute="trailing" secondItem="11092" secondAttribute="trailing" constant="15" id="11115"/>
|
<constraint firstAttribute="trailing" secondItem="11092" secondAttribute="trailing" constant="15" id="11115"/>
|
||||||
|
@ -437,15 +396,11 @@
|
||||||
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="10583">
|
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="10583">
|
||||||
<rect key="frame" x="0.0" y="20" width="414" height="50"/>
|
<rect key="frame" x="0.0" y="20" width="414" height="50"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<color key="barTintColor" red="0.23529411764705882" green="0.55294117647058827" blue="0.73725490196078436" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<textAttributes key="titleTextAttributes">
|
|
||||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
|
||||||
</textAttributes>
|
|
||||||
</navigationBar>
|
</navigationBar>
|
||||||
<nil name="viewControllers"/>
|
<nil name="viewControllers"/>
|
||||||
<connections>
|
<connections>
|
||||||
<segue destination="10570" kind="relationship" relationship="rootViewController" id="10939"/>
|
<segue destination="10570" kind="relationship" relationship="rootViewController" id="10939"/>
|
||||||
|
<outlet property="NaviBar2" destination="10583" id="name-outlet-10583"/>
|
||||||
</connections>
|
</connections>
|
||||||
</navigationController>
|
</navigationController>
|
||||||
<placeholder placeholderIdentifier="IBFirstResponder" id="10584" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
<placeholder placeholderIdentifier="IBFirstResponder" id="10584" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
using Bit.iOS.Core.Utilities;
|
||||||
using System;
|
using System;
|
||||||
using UIKit;
|
using UIKit;
|
||||||
|
|
||||||
|
@ -15,6 +16,13 @@ namespace Bit.iOS.Extension
|
||||||
public override UIBarButtonItem BaseSelectBarButton => SelectBarButton;
|
public override UIBarButtonItem BaseSelectBarButton => SelectBarButton;
|
||||||
public override UILabel BasePasswordLabel => PasswordLabel;
|
public override UILabel BasePasswordLabel => PasswordLabel;
|
||||||
|
|
||||||
|
public override void ViewDidLoad()
|
||||||
|
{
|
||||||
|
base.ViewDidLoad();
|
||||||
|
CancelBarButton.TintColor = ThemeHelpers.NavBarTextColor;
|
||||||
|
SelectBarButton.TintColor = ThemeHelpers.NavBarTextColor;
|
||||||
|
}
|
||||||
|
|
||||||
partial void SelectBarButton_Activated(UIBarButtonItem sender)
|
partial void SelectBarButton_Activated(UIBarButtonItem sender)
|
||||||
{
|
{
|
||||||
DismissViewController(true, () => Parent.PasswordCell.TextField.Text = PasswordLabel.Text);
|
DismissViewController(true, () => Parent.PasswordCell.TextField.Text = PasswordLabel.Text);
|
||||||
|
|
|
@ -3,6 +3,7 @@ using Bit.iOS.Extension.Models;
|
||||||
using UIKit;
|
using UIKit;
|
||||||
using Bit.iOS.Core.Controllers;
|
using Bit.iOS.Core.Controllers;
|
||||||
using Bit.App.Resources;
|
using Bit.App.Resources;
|
||||||
|
using Bit.iOS.Core.Utilities;
|
||||||
|
|
||||||
namespace Bit.iOS.Extension
|
namespace Bit.iOS.Extension
|
||||||
{
|
{
|
||||||
|
@ -15,26 +16,20 @@ namespace Bit.iOS.Extension
|
||||||
public Context Context { get; set; }
|
public Context Context { get; set; }
|
||||||
public LoadingViewController LoadingController { get; set; }
|
public LoadingViewController LoadingController { 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()
|
public override void ViewDidLoad()
|
||||||
{
|
{
|
||||||
View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f);
|
|
||||||
var descriptor = UIFontDescriptor.PreferredBody;
|
var descriptor = UIFontDescriptor.PreferredBody;
|
||||||
DescriptionLabel.Text = $@"{AppResources.ExtensionSetup}
|
DescriptionLabel.Text = $@"{AppResources.ExtensionSetup}
|
||||||
|
|
||||||
{AppResources.ExtensionSetup2}";
|
{AppResources.ExtensionSetup2}";
|
||||||
DescriptionLabel.Font = UIFont.FromDescriptor(descriptor, descriptor.PointSize);
|
DescriptionLabel.Font = UIFont.FromDescriptor(descriptor, descriptor.PointSize);
|
||||||
DescriptionLabel.TextColor = new UIColor(red: 0.47f, green: 0.47f, blue: 0.47f, alpha: 1.0f);
|
DescriptionLabel.TextColor = ThemeHelpers.MutedColor;
|
||||||
|
|
||||||
ActivatedLabel.Text = AppResources.ExtensionActivated;
|
ActivatedLabel.Text = AppResources.ExtensionActivated;
|
||||||
ActivatedLabel.Font = UIFont.FromDescriptor(descriptor, descriptor.PointSize * 1.3f);
|
ActivatedLabel.Font = UIFont.FromDescriptor(descriptor, descriptor.PointSize * 1.3f);
|
||||||
|
ActivatedLabel.TextColor = ThemeHelpers.SuccessColor;
|
||||||
|
|
||||||
|
BackButton.TintColor = ThemeHelpers.NavBarTextColor;
|
||||||
BackButton.Title = AppResources.Back;
|
BackButton.Title = AppResources.Back;
|
||||||
base.ViewDidLoad();
|
base.ViewDidLoad();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue