mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 02:18: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()
|
||||
{
|
||||
iOSCoreHelpers.AppearanceAdjustments();
|
||||
if(ServiceContainer.RegisteredServices.Count > 0)
|
||||
{
|
||||
return;
|
||||
|
@ -251,7 +252,6 @@ namespace Bit.iOS.Autofill
|
|||
ServiceContainer.Init();
|
||||
iOSCoreHelpers.RegisterHockeyApp();
|
||||
iOSCoreHelpers.Bootstrap();
|
||||
iOSCoreHelpers.AppearanceAdjustments();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -18,13 +18,6 @@ namespace Bit.iOS.Autofill
|
|||
public Context Context { 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()
|
||||
{
|
||||
base.ViewDidLoad();
|
||||
|
|
|
@ -6,6 +6,7 @@ using Bit.iOS.Core.Controllers;
|
|||
using Bit.App.Resources;
|
||||
using Bit.iOS.Core.Views;
|
||||
using Bit.iOS.Autofill.Utilities;
|
||||
using Bit.iOS.Core.Utilities;
|
||||
|
||||
namespace Bit.iOS.Autofill
|
||||
{
|
||||
|
@ -18,19 +19,16 @@ namespace Bit.iOS.Autofill
|
|||
public Context Context { 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()
|
||||
{
|
||||
base.ViewDidLoad();
|
||||
NavItem.Title = AppResources.SearchVault;
|
||||
CancelBarButton.Title = AppResources.Cancel;
|
||||
SearchBar.Placeholder = AppResources.Search;
|
||||
if(!ThemeHelpers.LightTheme)
|
||||
{
|
||||
SearchBar.BackgroundColor = SearchBar.BarTintColor = ThemeHelpers.BackgroundColor;
|
||||
}
|
||||
|
||||
TableView.RowHeight = UITableView.AutomaticDimension;
|
||||
TableView.EstimatedRowHeight = 44;
|
||||
|
|
|
@ -8,30 +8,24 @@ namespace Bit.iOS.Autofill
|
|||
{
|
||||
public partial class SetupViewController : ExtendedUIViewController
|
||||
{
|
||||
public SetupViewController(IntPtr handle) : base(handle)
|
||||
public SetupViewController(IntPtr handle)
|
||||
: base(handle)
|
||||
{ }
|
||||
|
||||
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()
|
||||
{
|
||||
View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f);
|
||||
var descriptor = UIFontDescriptor.PreferredBody;
|
||||
DescriptionLabel.Text = $@"{AppResources.AutofillSetup}
|
||||
|
||||
{AppResources.AutofillSetup2}";
|
||||
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.Font = UIFont.FromDescriptor(descriptor, descriptor.PointSize * 1.3f);
|
||||
ActivatedLabel.TextColor = ThemeHelpers.SuccessColor;
|
||||
|
||||
BackButton.Title = AppResources.Back;
|
||||
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 UIKit;
|
||||
|
||||
|
@ -8,5 +9,36 @@ namespace Bit.iOS.Core.Controllers
|
|||
public ExtendedUITableViewController(IntPtr 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 UIKit;
|
||||
|
||||
|
@ -8,5 +9,31 @@ namespace Bit.iOS.Core.Controllers
|
|||
public ExtendedUIViewController(IntPtr 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(
|
||||
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()
|
||||
{
|
||||
_lockService = ServiceContainer.Resolve<ILockService>("lockService");
|
||||
|
@ -66,7 +59,6 @@ namespace Bit.iOS.Core.Controllers
|
|||
BaseNavItem.Title = _pinLock ? AppResources.VerifyPIN : AppResources.VerifyMasterPassword;
|
||||
BaseCancelButton.Title = AppResources.Cancel;
|
||||
BaseSubmitButton.Title = AppResources.Submit;
|
||||
View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f);
|
||||
|
||||
var descriptor = UIFontDescriptor.PreferredBody;
|
||||
|
||||
|
@ -238,7 +230,7 @@ namespace Bit.iOS.Core.Controllers
|
|||
PresentViewController(alert, true, null);
|
||||
}
|
||||
|
||||
public class TableSource : UITableViewSource
|
||||
public class TableSource : ExtendedUITableViewSource
|
||||
{
|
||||
private LockPasswordViewController _controller;
|
||||
|
||||
|
@ -260,13 +252,13 @@ namespace Bit.iOS.Core.Controllers
|
|||
{
|
||||
if(indexPath.Row == 0)
|
||||
{
|
||||
var cell = new UITableViewCell();
|
||||
cell.TextLabel.TextColor = new UIColor(red: 0.24f, green: 0.55f, blue: 0.74f, alpha: 1.0f);
|
||||
var cell = new ExtendedUITableViewCell();
|
||||
cell.TextLabel.TextColor = ThemeHelpers.PrimaryColor;
|
||||
cell.TextLabel.Text = AppResources.UseFingerprintToUnlock;
|
||||
return cell;
|
||||
}
|
||||
}
|
||||
return new UITableViewCell();
|
||||
return new ExtendedUITableViewCell();
|
||||
}
|
||||
|
||||
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 UsernameCell { get; set; } = new FormEntryTableViewCell(AppResources.Username);
|
||||
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");
|
||||
public FormEntryTableViewCell UriCell { get; set; } = new FormEntryTableViewCell(AppResources.URI);
|
||||
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 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()
|
||||
{
|
||||
_cipherService = ServiceContainer.Resolve<ICipherService>("cipherService");
|
||||
|
@ -58,7 +51,7 @@ namespace Bit.iOS.Core.Controllers
|
|||
BaseNavItem.Title = AppResources.AddItem;
|
||||
BaseCancelButton.Title = AppResources.Cancel;
|
||||
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.ReturnKeyType = UIReturnKeyType.Next;
|
||||
|
@ -87,6 +80,8 @@ namespace Bit.iOS.Core.Controllers
|
|||
};
|
||||
|
||||
GeneratePasswordCell.TextLabel.Text = AppResources.GeneratePassword;
|
||||
GeneratePasswordCell.TextLabel.TextColor = GeneratePasswordCell.TextLabel.TintColor =
|
||||
ThemeHelpers.TextColor;
|
||||
GeneratePasswordCell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
|
||||
|
||||
UriCell.TextField.Text = Context?.UrlString ?? string.Empty;
|
||||
|
@ -206,7 +201,7 @@ namespace Bit.iOS.Core.Controllers
|
|||
AppResources.InternetConnectionRequiredMessage, AppResources.Ok);
|
||||
}
|
||||
|
||||
public class TableSource : UITableViewSource
|
||||
public class TableSource : ExtendedUITableViewSource
|
||||
{
|
||||
private LoginAddViewController _controller;
|
||||
|
||||
|
@ -256,7 +251,7 @@ namespace Bit.iOS.Core.Controllers
|
|||
return _controller.NotesCell;
|
||||
}
|
||||
|
||||
return new UITableViewCell();
|
||||
return new ExtendedUITableViewCell();
|
||||
}
|
||||
|
||||
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 NumbersCell { get; set; } = new SwitchTableViewCell("0-9");
|
||||
public SwitchTableViewCell SpecialCell { get; set; } = new SwitchTableViewCell("!@#$%^&*");
|
||||
public StepperTableViewCell MinNumbersCell { get; set; } = new StepperTableViewCell(AppResources.MinNumbers, 1, 0, 5, 1);
|
||||
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 StepperTableViewCell MinNumbersCell { get; set; } = new StepperTableViewCell(
|
||||
AppResources.MinNumbers, 1, 0, 5, 1);
|
||||
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 abstract UINavigationItem BaseNavItem { get; }
|
||||
|
@ -36,13 +39,6 @@ namespace Bit.iOS.Core.Controllers
|
|||
public abstract UIBarButtonItem BaseSelectBarButton { 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()
|
||||
{
|
||||
_passwordGenerationService = ServiceContainer.Resolve<IPasswordGenerationService>(
|
||||
|
@ -51,13 +47,13 @@ namespace Bit.iOS.Core.Controllers
|
|||
BaseNavItem.Title = AppResources.PasswordGenerator;
|
||||
BaseCancelButton.Title = AppResources.Cancel;
|
||||
BaseSelectBarButton.Title = AppResources.Select;
|
||||
View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f);
|
||||
|
||||
var descriptor = UIFontDescriptor.PreferredBody;
|
||||
BasePasswordLabel.Font = UIFont.FromName("Menlo-Regular", descriptor.PointSize * 1.3f);
|
||||
BasePasswordLabel.LineBreakMode = UILineBreakMode.TailTruncation;
|
||||
BasePasswordLabel.Lines = 1;
|
||||
BasePasswordLabel.AdjustsFontSizeToFitWidth = false;
|
||||
BasePasswordLabel.TextColor = ThemeHelpers.TextColor;
|
||||
|
||||
var controller = ChildViewControllers.LastOrDefault();
|
||||
if(controller != null)
|
||||
|
@ -71,7 +67,8 @@ namespace Bit.iOS.Core.Controllers
|
|||
OptionsTableViewController.TableView.EstimatedRowHeight = 70;
|
||||
OptionsTableViewController.TableView.Source = new TableSource(this);
|
||||
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();
|
||||
|
@ -159,7 +156,8 @@ namespace Bit.iOS.Core.Controllers
|
|||
|
||||
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()
|
||||
|
@ -177,7 +175,7 @@ namespace Bit.iOS.Core.Controllers
|
|||
});
|
||||
}
|
||||
|
||||
public class TableSource : UITableViewSource
|
||||
public class TableSource : ExtendedUITableViewSource
|
||||
{
|
||||
private PasswordGeneratorViewController _controller;
|
||||
|
||||
|
@ -190,8 +188,8 @@ namespace Bit.iOS.Core.Controllers
|
|||
{
|
||||
if(indexPath.Section == 0)
|
||||
{
|
||||
var cell = new UITableViewCell();
|
||||
cell.TextLabel.TextColor = new UIColor(red: 0.24f, green: 0.55f, blue: 0.74f, alpha: 1.0f);
|
||||
var cell = new ExtendedUITableViewCell();
|
||||
cell.TextLabel.TextColor = ThemeHelpers.PrimaryColor;
|
||||
if(indexPath.Row == 0)
|
||||
{
|
||||
cell.TextLabel.Text = AppResources.RegeneratePassword;
|
||||
|
@ -232,7 +230,7 @@ namespace Bit.iOS.Core.Controllers
|
|||
return _controller.MinSpecialCell;
|
||||
}
|
||||
|
||||
return new UITableViewCell();
|
||||
return new ExtendedUITableViewCell();
|
||||
}
|
||||
|
||||
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 BackgroundColor = Xamarin.Forms.Color.FromHex("#ffffff").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)
|
||||
{
|
||||
|
@ -24,6 +31,24 @@ namespace Bit.iOS.Core.Utilities
|
|||
{
|
||||
SetAppearance(theme);
|
||||
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)
|
||||
|
@ -31,21 +56,45 @@ namespace Bit.iOS.Core.Utilities
|
|||
LightTheme = false;
|
||||
if(theme == "dark")
|
||||
{
|
||||
var whiteColor = Xamarin.Forms.Color.FromHex("#ffffff").ToUIColor();
|
||||
MutedColor = Xamarin.Forms.Color.FromHex("#a3a3a3").ToUIColor();
|
||||
SuccessColor = Xamarin.Forms.Color.FromHex("#00a65a").ToUIColor();
|
||||
BackgroundColor = Xamarin.Forms.Color.FromHex("#303030").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")
|
||||
{
|
||||
var blackColor = Xamarin.Forms.Color.FromHex("#000000").ToUIColor();
|
||||
var whiteColor = Xamarin.Forms.Color.FromHex("#ffffff").ToUIColor();
|
||||
MutedColor = Xamarin.Forms.Color.FromHex("#a3a3a3").ToUIColor();
|
||||
BackgroundColor = Xamarin.Forms.Color.FromHex("#000000").ToUIColor();
|
||||
SplashBackgroundColor = BackgroundColor;
|
||||
SuccessColor = Xamarin.Forms.Color.FromHex("#00a65a").ToUIColor();
|
||||
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")
|
||||
{
|
||||
MutedColor = Xamarin.Forms.Color.FromHex("#d8dee9").ToUIColor();
|
||||
SuccessColor = Xamarin.Forms.Color.FromHex("#a3be8c").ToUIColor();
|
||||
BackgroundColor = Xamarin.Forms.Color.FromHex("#3b4252").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
|
||||
{
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
using Bit.Core.Abstractions;
|
||||
using Bit.Core.Models.View;
|
||||
using Bit.Core.Utilities;
|
||||
using Bit.iOS.Core.Controllers;
|
||||
using Bit.iOS.Core.Models;
|
||||
using Bit.iOS.Core.Utilities;
|
||||
using Foundation;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -14,7 +16,7 @@ using UIKit;
|
|||
|
||||
namespace Bit.iOS.Core.Views
|
||||
{
|
||||
public class ExtensionTableSource : UITableViewSource
|
||||
public class ExtensionTableSource : ExtendedUITableViewSource
|
||||
{
|
||||
private const string CellIdentifier = "TableCell";
|
||||
|
||||
|
@ -95,11 +97,12 @@ namespace Bit.iOS.Core.Views
|
|||
{
|
||||
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.TextAlignment = UITextAlignment.Center;
|
||||
noDataCell.TextLabel.LineBreakMode = UILineBreakMode.WordWrap;
|
||||
noDataCell.TextLabel.Lines = 0;
|
||||
noDataCell.TextLabel.TextColor = ThemeHelpers.TextColor;
|
||||
return noDataCell;
|
||||
}
|
||||
|
||||
|
@ -109,9 +112,9 @@ namespace Bit.iOS.Core.Views
|
|||
if(cell == null)
|
||||
{
|
||||
Debug.WriteLine("BW Log, Make new cell for list.");
|
||||
cell = new UITableViewCell(UITableViewCellStyle.Subtitle, CellIdentifier);
|
||||
cell.DetailTextLabel.TextColor = cell.DetailTextLabel.TintColor =
|
||||
new UIColor(red: 0.47f, green: 0.47f, blue: 0.47f, alpha: 1.0f);
|
||||
cell = new ExtendedUITableViewCell(UITableViewCellStyle.Subtitle, CellIdentifier);
|
||||
cell.TextLabel.TextColor = cell.TextLabel.TintColor = ThemeHelpers.TextColor;
|
||||
cell.DetailTextLabel.TextColor = cell.DetailTextLabel.TintColor = ThemeHelpers.MutedColor;
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
using System;
|
||||
using Bit.iOS.Core.Controllers;
|
||||
using Bit.iOS.Core.Utilities;
|
||||
using System;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Core.Views
|
||||
{
|
||||
public class FormEntryTableViewCell : UITableViewCell, ISelectable
|
||||
public class FormEntryTableViewCell : ExtendedUITableViewCell, ISelectable
|
||||
{
|
||||
public FormEntryTableViewCell(
|
||||
string labelName = null,
|
||||
|
@ -22,7 +24,7 @@ namespace Bit.iOS.Core.Views
|
|||
Text = labelName,
|
||||
TranslatesAutoresizingMaskIntoConstraints = false,
|
||||
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);
|
||||
|
@ -33,7 +35,10 @@ namespace Bit.iOS.Core.Views
|
|||
TextView = new UITextView
|
||||
{
|
||||
TranslatesAutoresizingMaskIntoConstraints = false,
|
||||
Font = UIFont.FromDescriptor(descriptor, pointSize)
|
||||
Font = UIFont.FromDescriptor(descriptor, pointSize),
|
||||
TextColor = ThemeHelpers.TextColor,
|
||||
TintColor = ThemeHelpers.TextColor,
|
||||
BackgroundColor = ThemeHelpers.BackgroundColor
|
||||
};
|
||||
|
||||
ContentView.Add(TextView);
|
||||
|
@ -67,7 +72,10 @@ namespace Bit.iOS.Core.Views
|
|||
TranslatesAutoresizingMaskIntoConstraints = false,
|
||||
BorderStyle = UITextBorderStyle.None,
|
||||
Font = UIFont.FromDescriptor(descriptor, pointSize),
|
||||
ClearButtonMode = UITextFieldViewMode.WhileEditing
|
||||
ClearButtonMode = UITextFieldViewMode.WhileEditing,
|
||||
TextColor = ThemeHelpers.TextColor,
|
||||
TintColor = ThemeHelpers.TextColor,
|
||||
BackgroundColor = ThemeHelpers.BackgroundColor
|
||||
};
|
||||
|
||||
if(useLabelAsPlaceholder)
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
using CoreGraphics;
|
||||
using Bit.iOS.Core.Controllers;
|
||||
using Bit.iOS.Core.Utilities;
|
||||
using CoreGraphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
@ -6,7 +8,7 @@ using UIKit;
|
|||
|
||||
namespace Bit.iOS.Core.Views
|
||||
{
|
||||
public class PickerTableViewCell : UITableViewCell, ISelectable
|
||||
public class PickerTableViewCell : ExtendedUITableViewCell, ISelectable
|
||||
{
|
||||
private List<string> _items = new List<string>();
|
||||
private int _selectedIndex = 0;
|
||||
|
@ -24,7 +26,7 @@ namespace Bit.iOS.Core.Views
|
|||
Text = labelName,
|
||||
TranslatesAutoresizingMaskIntoConstraints = false,
|
||||
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);
|
||||
|
@ -33,7 +35,10 @@ namespace Bit.iOS.Core.Views
|
|||
{
|
||||
BorderStyle = UITextBorderStyle.None,
|
||||
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;
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
using System;
|
||||
using Bit.iOS.Core.Controllers;
|
||||
using Bit.iOS.Core.Utilities;
|
||||
using System;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Core.Views
|
||||
{
|
||||
public class SliderTableViewCell : UITableViewCell
|
||||
public class SliderTableViewCell : ExtendedUITableViewCell
|
||||
{
|
||||
private string _detailRightSpace = "\t";
|
||||
private int _value;
|
||||
|
@ -12,14 +14,16 @@ namespace Bit.iOS.Core.Views
|
|||
: base(UITableViewCellStyle.Value1, nameof(SwitchTableViewCell))
|
||||
{
|
||||
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
|
||||
{
|
||||
MinValue = min,
|
||||
MaxValue = max,
|
||||
TintColor = new UIColor(red: 0.24f, green: 0.55f, blue: 0.74f, alpha: 1.0f),
|
||||
Frame = new CoreGraphics.CGRect(0, 0, 180, 30)
|
||||
TintColor = ThemeHelpers.PrimaryColor,
|
||||
Frame = new CoreGraphics.CGRect(0, 0, 180, 30),
|
||||
BackgroundColor = ThemeHelpers.BackgroundColor
|
||||
};
|
||||
Slider.ValueChanged += Slider_ValueChanged;
|
||||
Value = value;
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
using System;
|
||||
using Bit.iOS.Core.Controllers;
|
||||
using Bit.iOS.Core.Utilities;
|
||||
using System;
|
||||
using UIKit;
|
||||
|
||||
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.
|
||||
// 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))
|
||||
{
|
||||
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
|
||||
{
|
||||
TintColor = new UIColor(red: 0.47f, green: 0.47f, blue: 0.47f, alpha: 1.0f),
|
||||
TintColor = ThemeHelpers.MutedColor,
|
||||
MinimumValue = min,
|
||||
MaximumValue = max
|
||||
};
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
using System;
|
||||
using Bit.iOS.Core.Controllers;
|
||||
using Bit.iOS.Core.Utilities;
|
||||
using System;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Core.Views
|
||||
{
|
||||
public class SwitchTableViewCell : UITableViewCell
|
||||
public class SwitchTableViewCell : ExtendedUITableViewCell
|
||||
{
|
||||
public SwitchTableViewCell(string labelName)
|
||||
: base(UITableViewCellStyle.Default, nameof(SwitchTableViewCell))
|
||||
{
|
||||
TextLabel.Text = labelName;
|
||||
TextLabel.TextColor = ThemeHelpers.TextColor;
|
||||
Switch.TintColor = ThemeHelpers.MutedColor;
|
||||
Switch.OnTintColor = ThemeHelpers.PrimaryColor;
|
||||
AccessoryView = Switch;
|
||||
|
||||
Switch.ValueChanged += Switch_ValueChanged;
|
||||
|
|
|
@ -55,7 +55,9 @@
|
|||
<ItemGroup>
|
||||
<Compile Include="Constants.cs" />
|
||||
<Compile Include="Controllers\ExtendedUITableViewController.cs" />
|
||||
<Compile Include="Controllers\ExtendedUITableViewCell.cs" />
|
||||
<Compile Include="Controllers\ExtendedUIViewController.cs" />
|
||||
<Compile Include="Controllers\ExtendedUITableViewSource.cs" />
|
||||
<Compile Include="Controllers\LockPasswordViewController.cs" />
|
||||
<Compile Include="Controllers\LoginAddViewController.cs" />
|
||||
<Compile Include="Controllers\PasswordGeneratorViewController.cs" />
|
||||
|
|
|
@ -378,6 +378,7 @@ namespace Bit.iOS.Extension
|
|||
|
||||
private void InitApp()
|
||||
{
|
||||
iOSCoreHelpers.AppearanceAdjustments();
|
||||
if(ServiceContainer.RegisteredServices.Count > 0)
|
||||
{
|
||||
return;
|
||||
|
@ -386,7 +387,6 @@ namespace Bit.iOS.Extension
|
|||
ServiceContainer.Init();
|
||||
iOSCoreHelpers.RegisterHockeyApp();
|
||||
iOSCoreHelpers.Bootstrap();
|
||||
iOSCoreHelpers.AppearanceAdjustments();
|
||||
}
|
||||
|
||||
private bool IsLocked()
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
using Bit.iOS.Core.Utilities;
|
||||
using System;
|
||||
using UIKit;
|
||||
|
||||
|
@ -16,6 +17,13 @@ namespace Bit.iOS.Extension
|
|||
public override Action Success => () => LoadingController.DismissLockAndContinue();
|
||||
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)
|
||||
{
|
||||
var task = CheckPasswordAsync();
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Bit.iOS.Core.Utilities;
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
|
@ -17,6 +18,13 @@ namespace Bit.iOS.Extension
|
|||
public override UIBarButtonItem BaseCancelButton => CancelBarButton;
|
||||
public override UIBarButtonItem BaseSaveButton => SaveBarButton;
|
||||
|
||||
public override void ViewDidLoad()
|
||||
{
|
||||
base.ViewDidLoad();
|
||||
SaveBarButton.TintColor = ThemeHelpers.NavBarTextColor;
|
||||
CancelBarButton.TintColor = ThemeHelpers.NavBarTextColor;
|
||||
}
|
||||
|
||||
public override Action Success => () =>
|
||||
{
|
||||
if(LoginListController != null)
|
||||
|
|
|
@ -23,16 +23,11 @@ namespace Bit.iOS.Extension
|
|||
public Context Context { 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()
|
||||
{
|
||||
base.ViewDidLoad();
|
||||
AddBarButton.TintColor = ThemeHelpers.NavBarTextColor;
|
||||
CancelBarButton.TintColor = ThemeHelpers.NavBarTextColor;
|
||||
NavItem.Title = AppResources.Items;
|
||||
if(!CanAutoFill())
|
||||
{
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
<rect key="frame" x="66" y="316" width="282" height="44"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="1713" firstAttribute="centerY" secondItem="44" secondAttribute="centerY" constant="-30" id="1763"/>
|
||||
<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">
|
||||
<rect key="frame" x="0.0" y="20" width="414" height="50"/>
|
||||
<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>
|
||||
<nil name="viewControllers"/>
|
||||
<connections>
|
||||
|
@ -85,10 +79,6 @@
|
|||
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="1848">
|
||||
<rect key="frame" x="0.0" y="20" width="414" height="50"/>
|
||||
<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>
|
||||
<connections>
|
||||
<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">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
|
||||
<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/>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="2087" id="2089"/>
|
||||
|
@ -115,13 +103,11 @@
|
|||
</tableView>
|
||||
<navigationItem key="navigationItem" title="Add Login" id="2252">
|
||||
<barButtonItem key="leftBarButtonItem" title="Cancel" id="3747">
|
||||
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<connections>
|
||||
<action selector="CancelBarButton_Activated:" destination="2087" id="3751"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
<barButtonItem key="rightBarButtonItem" title="Save" id="3748">
|
||||
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<connections>
|
||||
<action selector="SaveBarButton_Activated:" destination="2087" id="3752"/>
|
||||
</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">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<prototypes>
|
||||
<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"/>
|
||||
|
@ -158,14 +143,12 @@
|
|||
<rect key="frame" x="20" y="4" width="35" height="21.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="18"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<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"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
|
@ -180,13 +163,11 @@
|
|||
<toolbarItems/>
|
||||
<navigationItem key="navigationItem" title="Logins" id="3734">
|
||||
<barButtonItem key="leftBarButtonItem" title="Cancel" id="3735">
|
||||
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<connections>
|
||||
<action selector="CancelBarButton_Activated:" destination="2304" id="3750"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
<barButtonItem key="rightBarButtonItem" systemItem="add" id="3736">
|
||||
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<connections>
|
||||
<action selector="AddBarButton_Activated:" destination="2304" id="3749"/>
|
||||
</connections>
|
||||
|
@ -211,11 +192,6 @@
|
|||
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="4577">
|
||||
<rect key="frame" x="0.0" y="20" width="414" height="50"/>
|
||||
<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>
|
||||
<connections>
|
||||
<segue destination="4576" kind="relationship" relationship="rootViewController" id="4575"/>
|
||||
|
@ -239,16 +215,13 @@
|
|||
<subviews>
|
||||
<containerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4933">
|
||||
<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>
|
||||
<segue destination="4912" kind="embed" id="6480"/>
|
||||
</connections>
|
||||
</containerView>
|
||||
<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"/>
|
||||
<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"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
|
@ -264,13 +237,11 @@
|
|||
</view>
|
||||
<navigationItem key="navigationItem" title="Generate Password" id="4580">
|
||||
<barButtonItem key="leftBarButtonItem" title="Cancel" id="4807">
|
||||
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<connections>
|
||||
<action selector="CancelBarButton_Activated:" destination="4576" id="4887"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
<barButtonItem key="rightBarButtonItem" title="Select" id="4808">
|
||||
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<connections>
|
||||
<action selector="SelectBarButton_Activated:" destination="4576" id="4810"/>
|
||||
</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">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="575.5"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="4912" id="4914"/>
|
||||
<outlet property="delegate" destination="4912" id="4915"/>
|
||||
|
@ -318,11 +288,6 @@
|
|||
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="6857">
|
||||
<rect key="frame" x="0.0" y="20" width="414" height="50"/>
|
||||
<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>
|
||||
<connections>
|
||||
<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">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="7413" id="7415"/>
|
||||
<outlet property="delegate" destination="7413" id="7416"/>
|
||||
|
@ -382,23 +346,18 @@
|
|||
<subviews>
|
||||
<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"/>
|
||||
<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"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<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"/>
|
||||
<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"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<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"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="11092" firstAttribute="leading" secondItem="10575" secondAttribute="leading" constant="15" id="11114"/>
|
||||
<constraint firstAttribute="trailing" secondItem="11092" secondAttribute="trailing" constant="15" id="11115"/>
|
||||
|
@ -437,15 +396,11 @@
|
|||
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="10583">
|
||||
<rect key="frame" x="0.0" y="20" width="414" height="50"/>
|
||||
<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>
|
||||
<nil name="viewControllers"/>
|
||||
<connections>
|
||||
<segue destination="10570" kind="relationship" relationship="rootViewController" id="10939"/>
|
||||
<outlet property="NaviBar2" destination="10583" id="name-outlet-10583"/>
|
||||
</connections>
|
||||
</navigationController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="10584" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
using Bit.iOS.Core.Utilities;
|
||||
using System;
|
||||
using UIKit;
|
||||
|
||||
|
@ -15,6 +16,13 @@ namespace Bit.iOS.Extension
|
|||
public override UIBarButtonItem BaseSelectBarButton => SelectBarButton;
|
||||
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)
|
||||
{
|
||||
DismissViewController(true, () => Parent.PasswordCell.TextField.Text = PasswordLabel.Text);
|
||||
|
|
|
@ -3,6 +3,7 @@ using Bit.iOS.Extension.Models;
|
|||
using UIKit;
|
||||
using Bit.iOS.Core.Controllers;
|
||||
using Bit.App.Resources;
|
||||
using Bit.iOS.Core.Utilities;
|
||||
|
||||
namespace Bit.iOS.Extension
|
||||
{
|
||||
|
@ -15,26 +16,20 @@ namespace Bit.iOS.Extension
|
|||
public Context Context { 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()
|
||||
{
|
||||
View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f);
|
||||
var descriptor = UIFontDescriptor.PreferredBody;
|
||||
DescriptionLabel.Text = $@"{AppResources.ExtensionSetup}
|
||||
|
||||
{AppResources.ExtensionSetup2}";
|
||||
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.Font = UIFont.FromDescriptor(descriptor, descriptor.PointSize * 1.3f);
|
||||
ActivatedLabel.TextColor = ThemeHelpers.SuccessColor;
|
||||
|
||||
BackButton.TintColor = ThemeHelpers.NavBarTextColor;
|
||||
BackButton.Title = AppResources.Back;
|
||||
base.ViewDidLoad();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue