1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-23 11:45:38 +01:00

App: Use Windows helper instead of WinPhone (#203)

Signed-off-by: Alistair Francis <alistair@alistair23.me>
This commit is contained in:
Alistair Francis 2017-12-10 20:26:58 -08:00 committed by Kyle Spearrin
parent 45c0ec9035
commit de20bb22d9
14 changed files with 19 additions and 19 deletions

View File

@ -11,7 +11,7 @@ namespace Bit.App.Controls
BindableProperty.Create(nameof(Padding), typeof(Thickness), typeof(ExtendedButton), default(Thickness)); BindableProperty.Create(nameof(Padding), typeof(Thickness), typeof(ExtendedButton), default(Thickness));
public static readonly BindableProperty UppercaseProperty = public static readonly BindableProperty UppercaseProperty =
BindableProperty.Create(nameof(Uppercase), typeof(bool), typeof(ExtendedButton), BindableProperty.Create(nameof(Uppercase), typeof(bool), typeof(ExtendedButton),
Helpers.OnPlatform(iOS: false, Android: true, WinPhone: false)); Helpers.OnPlatform(iOS: false, Android: true, Windows: false));
public Thickness Padding public Thickness Padding
{ {

View File

@ -14,7 +14,7 @@ namespace Bit.App.Controls
{ {
HorizontalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center,
FontSize = 35, FontSize = 35,
FontFamily = Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", WinPhone: "Courier") FontFamily = Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", Windows: "Courier")
}; };
Entry = new ExtendedEntry Entry = new ExtendedEntry

View File

@ -43,7 +43,7 @@ namespace Bit.App.Controls
Padding = Helpers.OnPlatform( Padding = Helpers.OnPlatform(
iOS: new Thickness(15, 8), iOS: new Thickness(15, 8),
Android: new Thickness(15, 2), Android: new Thickness(15, 2),
WinPhone: new Thickness(15, 8)) Windows: new Thickness(15, 8))
}; };
if(Device.RuntimePlatform == Device.Android) if(Device.RuntimePlatform == Device.Android)

View File

@ -33,7 +33,7 @@ namespace Bit.App.Pages
var padding = Helpers.OnPlatform( var padding = Helpers.OnPlatform(
iOS: new Thickness(15, 20), iOS: new Thickness(15, 20),
Android: new Thickness(15, 8), Android: new Thickness(15, 8),
WinPhone: new Thickness(15, 20)); Windows: new Thickness(10, 8));
PasswordCell = new FormEntryCell(AppResources.MasterPassword, isPassword: true, PasswordCell = new FormEntryCell(AppResources.MasterPassword, isPassword: true,
useLabelAsPlaceholder: true, imageSource: "lock.png", containerPadding: padding); useLabelAsPlaceholder: true, imageSource: "lock.png", containerPadding: padding);

View File

@ -123,7 +123,7 @@ namespace Bit.App.Pages
var padding = Helpers.OnPlatform( var padding = Helpers.OnPlatform(
iOS: new Thickness(15, 20), iOS: new Thickness(15, 20),
Android: new Thickness(15, 8), Android: new Thickness(15, 8),
WinPhone: new Thickness(15, 20)); Windows: new Thickness(10, 8));
TokenCell = new FormEntryCell(AppResources.VerificationCode, useLabelAsPlaceholder: true, TokenCell = new FormEntryCell(AppResources.VerificationCode, useLabelAsPlaceholder: true,
imageSource: "lock", containerPadding: padding); imageSource: "lock", containerPadding: padding);

View File

@ -33,7 +33,7 @@ namespace Bit.App.Pages
var padding = Helpers.OnPlatform( var padding = Helpers.OnPlatform(
iOS: new Thickness(15, 20), iOS: new Thickness(15, 20),
Android: new Thickness(15, 8), Android: new Thickness(15, 8),
WinPhone: new Thickness(15, 20)); Windows: new Thickness(10, 8));
EmailCell = new FormEntryCell(AppResources.EmailAddress, entryKeyboard: Keyboard.Email, EmailCell = new FormEntryCell(AppResources.EmailAddress, entryKeyboard: Keyboard.Email,
useLabelAsPlaceholder: true, imageSource: "envelope.png", containerPadding: padding); useLabelAsPlaceholder: true, imageSource: "envelope.png", containerPadding: padding);

View File

@ -47,7 +47,7 @@ namespace Bit.App.Pages
var padding = Helpers.OnPlatform( var padding = Helpers.OnPlatform(
iOS: new Thickness(15, 20), iOS: new Thickness(15, 20),
Android: new Thickness(15, 8), Android: new Thickness(15, 8),
WinPhone: new Thickness(15, 20)); Windows: new Thickness(10, 8));
PasswordHintCell = new FormEntryCell(AppResources.MasterPasswordHint, useLabelAsPlaceholder: true, PasswordHintCell = new FormEntryCell(AppResources.MasterPasswordHint, useLabelAsPlaceholder: true,
imageSource: "lightbulb.png", containerPadding: padding); imageSource: "lightbulb.png", containerPadding: padding);

View File

@ -69,7 +69,7 @@ Fingerprint by masterpage.com from the Noun Project")
Padding = Helpers.OnPlatform( Padding = Helpers.OnPlatform(
iOS: new Thickness(15, 20), iOS: new Thickness(15, 20),
Android: new Thickness(16, 20), Android: new Thickness(16, 20),
WinPhone: new Thickness(15, 20)), Windows: new Thickness(10, 8)),
BackgroundColor = Color.White BackgroundColor = Color.White
}; };

View File

@ -95,7 +95,7 @@ namespace Bit.App.Pages
{ {
var fingerprintName = Helpers.OnPlatform( var fingerprintName = Helpers.OnPlatform(
iOS: _deviceInfoService.HasFaceIdSupport ? AppResources.FaceID : AppResources.TouchID, iOS: _deviceInfoService.HasFaceIdSupport ? AppResources.FaceID : AppResources.TouchID,
Android: AppResources.Fingerprint, Windows: AppResources.Fingerprint, WinPhone: AppResources.Fingerprint); Android: AppResources.Fingerprint, Windows: AppResources.Fingerprint);
FingerprintCell = new ExtendedSwitchCell FingerprintCell = new ExtendedSwitchCell
{ {
Text = string.Format(AppResources.UnlockWith, fingerprintName), Text = string.Format(AppResources.UnlockWith, fingerprintName),

View File

@ -49,7 +49,7 @@ namespace Bit.App.Pages
FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)), FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
Margin = new Thickness(15, 40, 15, 40), Margin = new Thickness(15, 40, 15, 40),
HorizontalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center,
FontFamily = Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", WinPhone: "Courier"), FontFamily = Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", Windows: "Courier"),
LineBreakMode = LineBreakMode.TailTruncation, LineBreakMode = LineBreakMode.TailTruncation,
VerticalOptions = LayoutOptions.Start VerticalOptions = LayoutOptions.Start
}; };
@ -259,7 +259,7 @@ namespace Bit.App.Pages
Padding = Helpers.OnPlatform( Padding = Helpers.OnPlatform(
iOS: new Thickness(15, 8), iOS: new Thickness(15, 8),
Android: new Thickness(16, 10), Android: new Thickness(16, 10),
WinPhone: new Thickness(15, 8)) Windows: new Thickness(15, 8))
}; };
stackLayout.AdjustPaddingForDevice(); stackLayout.AdjustPaddingForDevice();

View File

@ -388,7 +388,7 @@ namespace Bit.App.Pages
LoginTotpCell.Entry.DisableAutocapitalize = true; LoginTotpCell.Entry.DisableAutocapitalize = true;
LoginTotpCell.Entry.Autocorrect = false; LoginTotpCell.Entry.Autocorrect = false;
LoginTotpCell.Entry.FontFamily = LoginTotpCell.Entry.FontFamily =
Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", WinPhone: "Courier"); Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", Windows: "Courier");
LoginPasswordCell = new FormEntryCell(AppResources.Password, isPassword: true, nextElement: LoginTotpCell.Entry, LoginPasswordCell = new FormEntryCell(AppResources.Password, isPassword: true, nextElement: LoginTotpCell.Entry,
useButton: true); useButton: true);
@ -396,7 +396,7 @@ namespace Bit.App.Pages
LoginPasswordCell.Entry.DisableAutocapitalize = true; LoginPasswordCell.Entry.DisableAutocapitalize = true;
LoginPasswordCell.Entry.Autocorrect = false; LoginPasswordCell.Entry.Autocorrect = false;
LoginPasswordCell.Entry.FontFamily = LoginPasswordCell.Entry.FontFamily =
Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", WinPhone: "Courier"); Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", Windows: "Courier");
if(!string.IsNullOrWhiteSpace(_defaultPassword)) if(!string.IsNullOrWhiteSpace(_defaultPassword))
{ {
LoginPasswordCell.Entry.Text = _defaultPassword; LoginPasswordCell.Entry.Text = _defaultPassword;

View File

@ -182,7 +182,7 @@ namespace Bit.App.Pages
if(hidden) if(hidden)
{ {
textFieldCell.Entry.FontFamily = Helpers.OnPlatform( textFieldCell.Entry.FontFamily = Helpers.OnPlatform(
iOS: "Menlo-Regular", Android: "monospace", WinPhone: "Courier"); iOS: "Menlo-Regular", Android: "monospace", Windows: "Courier");
textFieldCell.Button.Image = "eye.png"; textFieldCell.Button.Image = "eye.png";
textFieldCell.Button.Command = new Command(() => textFieldCell.Button.Command = new Command(() =>
{ {

View File

@ -186,7 +186,7 @@ namespace Bit.App.Pages
LoginTotpCell.Entry.DisableAutocapitalize = true; LoginTotpCell.Entry.DisableAutocapitalize = true;
LoginTotpCell.Entry.Autocorrect = false; LoginTotpCell.Entry.Autocorrect = false;
LoginTotpCell.Entry.FontFamily = LoginTotpCell.Entry.FontFamily =
Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", WinPhone: "Courier"); Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", Windows: "Courier");
LoginPasswordCell = new FormEntryCell(AppResources.Password, isPassword: true, LoginPasswordCell = new FormEntryCell(AppResources.Password, isPassword: true,
nextElement: LoginTotpCell.Entry, useButton: true); nextElement: LoginTotpCell.Entry, useButton: true);
@ -195,7 +195,7 @@ namespace Bit.App.Pages
LoginPasswordCell.Entry.DisableAutocapitalize = true; LoginPasswordCell.Entry.DisableAutocapitalize = true;
LoginPasswordCell.Entry.Autocorrect = false; LoginPasswordCell.Entry.Autocorrect = false;
LoginPasswordCell.Entry.FontFamily = LoginPasswordCell.Entry.FontFamily =
Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", WinPhone: "Courier"); Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", Windows: "Courier");
LoginGenerateCell = new ExtendedTextCell LoginGenerateCell = new ExtendedTextCell
{ {

View File

@ -126,7 +126,7 @@ namespace Bit.App.Pages
LoginPasswordCell.Button2.Command = LoginPasswordCell.Button2.Command =
new Command(() => Copy(Model.LoginPassword, AppResources.Password)); new Command(() => Copy(Model.LoginPassword, AppResources.Password));
LoginPasswordCell.Value.FontFamily = LoginPasswordCell.Value.FontFamily =
Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", WinPhone: "Courier"); Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", Windows: "Courier");
LoginPasswordCell.Value.LineBreakMode = LineBreakMode.WordWrap; LoginPasswordCell.Value.LineBreakMode = LineBreakMode.WordWrap;
// URI // URI
@ -159,7 +159,7 @@ namespace Bit.App.Pages
LoginTotpCodeCell.Sub.SetBinding(Label.TextColorProperty, LoginTotpCodeCell.Sub.SetBinding(Label.TextColorProperty,
nameof(VaultViewCipherPageModel.LoginTotpColor)); nameof(VaultViewCipherPageModel.LoginTotpColor));
LoginTotpCodeCell.Value.FontFamily = LoginTotpCodeCell.Value.FontFamily =
Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", WinPhone: "Courier"); Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", Windows: "Courier");
break; break;
case CipherType.Card: case CipherType.Card:
CardNameCell = new LabeledValueCell(AppResources.CardholderName); CardNameCell = new LabeledValueCell(AppResources.CardholderName);
@ -558,7 +558,7 @@ namespace Bit.App.Pages
: base(field.Name, field.MaskedValue, string.Empty, "clipboard.png") : base(field.Name, field.MaskedValue, string.Empty, "clipboard.png")
{ {
Value.FontFamily = Helpers.OnPlatform(iOS: "Menlo-Regular", Value.FontFamily = Helpers.OnPlatform(iOS: "Menlo-Regular",
Android: "monospace", WinPhone: "Courier"); Android: "monospace", Windows: "Courier");
if(Device.RuntimePlatform == Device.iOS) if(Device.RuntimePlatform == Device.iOS)
{ {
Button1.Margin = new Thickness(10, 0); Button1.Margin = new Thickness(10, 0);