From e5e3ebdbba7d6e3448ac65714d2c691229a00a6b Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 29 Jun 2018 12:45:10 -0400 Subject: [PATCH] update to Xamarin forms 3.1 --- src/Android/Controls/ExtendedEntryRenderer.cs | 16 ++++----- src/Android/Resources/Resource.Designer.cs | 33 +++++++++++++++---- src/App/App.csproj | 2 +- src/App/Controls/ExtendedEntry.cs | 12 +++---- src/App/Controls/FormEntryCell.cs | 4 +-- src/App/Controls/PinControl.cs | 2 +- src/App/Pages/Lock/LockPasswordPage.cs | 2 +- src/App/Pages/LoginPage.cs | 2 +- src/App/Pages/LoginTwoFactorPage.cs | 4 +-- src/App/Pages/PasswordHintPage.cs | 2 +- src/App/Pages/RegisterPage.cs | 2 +- .../Pages/Tools/ToolsPasswordGeneratorPage.cs | 4 ++- src/App/Utilities/Helpers.cs | 2 -- src/iOS/Controls/ExtendedEntryRenderer.cs | 6 ++-- 14 files changed, 57 insertions(+), 36 deletions(-) diff --git a/src/Android/Controls/ExtendedEntryRenderer.cs b/src/Android/Controls/ExtendedEntryRenderer.cs index 4cf1a1cde..10dab3ab1 100644 --- a/src/Android/Controls/ExtendedEntryRenderer.cs +++ b/src/Android/Controls/ExtendedEntryRenderer.cs @@ -112,7 +112,7 @@ namespace Bit.Android.Controls private void Control_EditorAction(object sender, TextView.EditorActionEventArgs e) { - if(_view.ReturnType != ReturnType.Next) + if(_view.TargetReturnType != Bit.App.Enums.ReturnType.Next) { _view.Unfocus(); } @@ -165,23 +165,23 @@ namespace Bit.Android.Controls private void SetReturnType(ExtendedEntry view) { - if(view.ReturnType.HasValue) + if(view.TargetReturnType.HasValue) { - switch(view.ReturnType.Value) + switch(view.TargetReturnType.Value) { - case ReturnType.Go: + case App.Enums.ReturnType.Go: Control.ImeOptions = ImeAction.Go; Control.SetImeActionLabel("Go", ImeAction.Go); break; - case ReturnType.Next: + case App.Enums.ReturnType.Next: Control.ImeOptions = ImeAction.Next; Control.SetImeActionLabel("Next", ImeAction.Next); break; - case ReturnType.Search: + case App.Enums.ReturnType.Search: Control.ImeOptions = ImeAction.Search; Control.SetImeActionLabel("Search", ImeAction.Search); break; - case ReturnType.Send: + case App.Enums.ReturnType.Send: Control.ImeOptions = ImeAction.Send; Control.SetImeActionLabel("Send", ImeAction.Send); break; @@ -206,7 +206,7 @@ namespace Bit.Android.Controls private void SetMaxLength(ExtendedEntry view) { - Control.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(view.MaxLength) }); + Control.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(view.TargetMaxLength) }); } } } diff --git a/src/Android/Resources/Resource.Designer.cs b/src/Android/Resources/Resource.Designer.cs index 0b02de05c..78192fef5 100644 --- a/src/Android/Resources/Resource.Designer.cs +++ b/src/Android/Resources/Resource.Designer.cs @@ -6509,17 +6509,17 @@ namespace Bit.Android // aapt resource value: 0x7f0a0051 public const int ApplicationName = 2131361873; - // aapt resource value: 0x7f0a00ab - public const int AutoFillServiceDescription = 2131361963; + // aapt resource value: 0x7f0a00b2 + public const int AutoFillServiceDescription = 2131361970; - // aapt resource value: 0x7f0a00aa - public const int AutoFillServiceSummary = 2131361962; + // aapt resource value: 0x7f0a00b1 + public const int AutoFillServiceSummary = 2131361969; // aapt resource value: 0x7f0a0050 public const int Hello = 2131361872; - // aapt resource value: 0x7f0a00ac - public const int MyVault = 2131361964; + // aapt resource value: 0x7f0a00b3 + public const int MyVault = 2131361971; // aapt resource value: 0x7f0a0027 public const int abc_action_bar_home_description = 2131361831; @@ -6674,6 +6674,27 @@ namespace Bit.Android // aapt resource value: 0x7f0a000f public const int common_signin_button_text_long = 2131361807; + // aapt resource value: 0x7f0a00ac + public const int default_web_client_id = 2131361964; + + // aapt resource value: 0x7f0a00ad + public const int firebase_database_url = 2131361965; + + // aapt resource value: 0x7f0a00aa + public const int gcm_defaultSenderId = 2131361962; + + // aapt resource value: 0x7f0a00ae + public const int google_api_key = 2131361966; + + // aapt resource value: 0x7f0a00ab + public const int google_app_id = 2131361963; + + // aapt resource value: 0x7f0a00af + public const int google_crash_reporting_api_key = 2131361967; + + // aapt resource value: 0x7f0a00b0 + public const int google_storage_bucket = 2131361968; + // aapt resource value: 0x7f0a0052 public const int hockeyapp_crash_dialog_app_name_fallback = 2131361874; diff --git a/src/App/App.csproj b/src/App/App.csproj index ee3890f90..14844efe6 100644 --- a/src/App/App.csproj +++ b/src/App/App.csproj @@ -35,7 +35,7 @@ - + diff --git a/src/App/Controls/ExtendedEntry.cs b/src/App/Controls/ExtendedEntry.cs index b9685ee20..c41426976 100644 --- a/src/App/Controls/ExtendedEntry.cs +++ b/src/App/Controls/ExtendedEntry.cs @@ -25,8 +25,8 @@ namespace Bit.App.Controls public static readonly BindableProperty BottomBorderColorProperty = BindableProperty.Create(nameof(BottomBorderColor), typeof(Color), typeof(ExtendedEntry), Color.Default); - public static readonly BindableProperty MaxLengthProperty = - BindableProperty.Create(nameof(MaxLength), typeof(int), typeof(ExtendedEntry), int.MaxValue); + public static readonly BindableProperty TargetMaxLengthProperty = + BindableProperty.Create(nameof(TargetMaxLength), typeof(int), typeof(ExtendedEntry), int.MaxValue); public bool HasBorder { @@ -46,13 +46,13 @@ namespace Bit.App.Controls set { SetValue(BottomBorderColorProperty, value); } } - public int MaxLength + public int TargetMaxLength { - get { return (int)GetValue(MaxLengthProperty); } - set { SetValue(MaxLengthProperty, value); } + get { return (int)GetValue(TargetMaxLengthProperty); } + set { SetValue(TargetMaxLengthProperty, value); } } - public ReturnType? ReturnType { get; set; } + public Enums.ReturnType? TargetReturnType { get; set; } public bool? Autocorrect { get; set; } public bool DisableAutocapitalize { get; set; } public bool AllowClear { get; set; } diff --git a/src/App/Controls/FormEntryCell.cs b/src/App/Controls/FormEntryCell.cs index 8ceb1dc3d..4d30c9516 100644 --- a/src/App/Controls/FormEntryCell.cs +++ b/src/App/Controls/FormEntryCell.cs @@ -171,11 +171,11 @@ namespace Bit.App.Controls _nextElement = value; if(_nextElement != null && Entry != null) { - Entry.ReturnType = Enums.ReturnType.Next; + Entry.TargetReturnType = Enums.ReturnType.Next; } else if(Entry != null) { - Entry.ReturnType = null; + Entry.TargetReturnType = null; } } } diff --git a/src/App/Controls/PinControl.cs b/src/App/Controls/PinControl.cs index 767b6207a..0903fdc0d 100644 --- a/src/App/Controls/PinControl.cs +++ b/src/App/Controls/PinControl.cs @@ -20,7 +20,7 @@ namespace Bit.App.Controls Entry = new ExtendedEntry { Keyboard = Keyboard.Numeric, - MaxLength = 4, + TargetMaxLength = 4, HideCursor = true }; diff --git a/src/App/Pages/Lock/LockPasswordPage.cs b/src/App/Pages/Lock/LockPasswordPage.cs index dad5eae6c..f993039e0 100644 --- a/src/App/Pages/Lock/LockPasswordPage.cs +++ b/src/App/Pages/Lock/LockPasswordPage.cs @@ -38,7 +38,7 @@ namespace Bit.App.Pages PasswordCell = new FormEntryCell(AppResources.MasterPassword, isPassword: true, useLabelAsPlaceholder: true, imageSource: "lock.png", containerPadding: padding); - PasswordCell.Entry.ReturnType = Enums.ReturnType.Go; + PasswordCell.Entry.TargetReturnType = Enums.ReturnType.Go; var table = new ExtendedTableView { diff --git a/src/App/Pages/LoginPage.cs b/src/App/Pages/LoginPage.cs index 832f81aba..eb49ad49d 100644 --- a/src/App/Pages/LoginPage.cs +++ b/src/App/Pages/LoginPage.cs @@ -62,7 +62,7 @@ namespace Bit.App.Pages EmailCell.Entry.Text = lastLoginEmail; } - PasswordCell.Entry.ReturnType = Enums.ReturnType.Go; + PasswordCell.Entry.TargetReturnType = Enums.ReturnType.Go; var table = new ExtendedTableView { diff --git a/src/App/Pages/LoginTwoFactorPage.cs b/src/App/Pages/LoginTwoFactorPage.cs index 27d41dcf5..c045afe1b 100644 --- a/src/App/Pages/LoginTwoFactorPage.cs +++ b/src/App/Pages/LoginTwoFactorPage.cs @@ -129,7 +129,7 @@ namespace Bit.App.Pages imageSource: "lock", containerPadding: padding); TokenCell.Entry.Keyboard = Keyboard.Numeric; - TokenCell.Entry.ReturnType = ReturnType.Go; + TokenCell.Entry.TargetReturnType = Enums.ReturnType.Go; var table = new TwoFactorTable( new TableSection(Helpers.GetEmptyTableSectionTitle()) @@ -254,7 +254,7 @@ namespace Bit.App.Pages { TokenCell = new FormEntryCell("", isPassword: true, imageSource: "lock", useLabelAsPlaceholder: true); - TokenCell.Entry.ReturnType = ReturnType.Go; + TokenCell.Entry.TargetReturnType = Enums.ReturnType.Go; section.Insert(0, TokenCell); } diff --git a/src/App/Pages/PasswordHintPage.cs b/src/App/Pages/PasswordHintPage.cs index 26c944f74..f6ca02744 100644 --- a/src/App/Pages/PasswordHintPage.cs +++ b/src/App/Pages/PasswordHintPage.cs @@ -36,7 +36,7 @@ namespace Bit.App.Pages EmailCell = new FormEntryCell(AppResources.EmailAddress, entryKeyboard: Keyboard.Email, useLabelAsPlaceholder: true, imageSource: "envelope.png", containerPadding: padding); - EmailCell.Entry.ReturnType = Enums.ReturnType.Go; + EmailCell.Entry.TargetReturnType = Enums.ReturnType.Go; var table = new ExtendedTableView { diff --git a/src/App/Pages/RegisterPage.cs b/src/App/Pages/RegisterPage.cs index 0bd35dc50..183e3d49b 100644 --- a/src/App/Pages/RegisterPage.cs +++ b/src/App/Pages/RegisterPage.cs @@ -60,7 +60,7 @@ namespace Bit.App.Pages entryKeyboard: Keyboard.Email, useLabelAsPlaceholder: true, imageSource: "envelope.png", containerPadding: padding); - PasswordHintCell.Entry.ReturnType = Enums.ReturnType.Done; + PasswordHintCell.Entry.TargetReturnType = Enums.ReturnType.Done; var table = new FormTableView(this) { diff --git a/src/App/Pages/Tools/ToolsPasswordGeneratorPage.cs b/src/App/Pages/Tools/ToolsPasswordGeneratorPage.cs index 59fded1c9..121da21cb 100644 --- a/src/App/Pages/Tools/ToolsPasswordGeneratorPage.cs +++ b/src/App/Pages/Tools/ToolsPasswordGeneratorPage.cs @@ -400,7 +400,9 @@ namespace Bit.App.Pages LengthSlider = new Slider(5, 64, _settings.GetValueOrDefault(Constants.PasswordGeneratorLength, 10)) { HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand + VerticalOptions = LayoutOptions.CenterAndExpand, + MaximumTrackColor = Color.Gray, + MinimumTrackColor = Color.Gray, }; Value = new Label diff --git a/src/App/Utilities/Helpers.cs b/src/App/Utilities/Helpers.cs index d310a40a8..f4d28dc3d 100644 --- a/src/App/Utilities/Helpers.cs +++ b/src/App/Utilities/Helpers.cs @@ -47,8 +47,6 @@ namespace Bit.App.Utilities return iOS; case Device.Android: return Android; - case Device.WinPhone: - return WinPhone; case Device.UWP: return Windows; default: diff --git a/src/iOS/Controls/ExtendedEntryRenderer.cs b/src/iOS/Controls/ExtendedEntryRenderer.cs index fdb2edffb..015e15da4 100644 --- a/src/iOS/Controls/ExtendedEntryRenderer.cs +++ b/src/iOS/Controls/ExtendedEntryRenderer.cs @@ -46,9 +46,9 @@ namespace Bit.iOS.Controls Control.TintColor = UIColor.Clear; } - if(view.ReturnType.HasValue) + if(view.TargetReturnType.HasValue) { - switch(view.ReturnType.Value) + switch(view.TargetReturnType.Value) { case App.Enums.ReturnType.Done: Control.ReturnKeyType = UIReturnKeyType.Done; @@ -171,7 +171,7 @@ namespace Bit.iOS.Controls Control.ShouldChangeCharacters = (textField, range, replacementString) => { var newLength = textField.Text.Length + replacementString.Length - range.Length; - return newLength <= view.MaxLength; + return newLength <= view.TargetMaxLength; }; }