mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 01:48:25 +03:00
update to Xamarin forms 3.1
This commit is contained in:
parent
993fc2e6f4
commit
e5e3ebdbba
14 changed files with 57 additions and 36 deletions
|
@ -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) });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
33
src/Android/Resources/Resource.Designer.cs
generated
33
src/Android/Resources/Resource.Designer.cs
generated
|
@ -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;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<PackageReference Include="Xam.Plugin.Connectivity" Version="3.0.3" />
|
||||
<PackageReference Include="Xam.Plugins.Settings" Version="3.1.1" />
|
||||
<PackageReference Include="Xamarin.FFImageLoading.Forms" Version="2.3.4" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="2.5.0.122203" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="3.1.0.583944" />
|
||||
<PackageReference Include="XLabs.IoC" Version="2.0.5782" />
|
||||
<PackageReference Include="ZXing.Net.Mobile.Forms" Version="2.1.47" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace Bit.App.Controls
|
|||
Entry = new ExtendedEntry
|
||||
{
|
||||
Keyboard = Keyboard.Numeric,
|
||||
MaxLength = 4,
|
||||
TargetMaxLength = 4,
|
||||
HideCursor = true
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue