diff --git a/src/App/Models/Page/VaultViewLoginPageModel.cs b/src/App/Models/Page/VaultViewLoginPageModel.cs index 6ebd79e0c..6425b610b 100644 --- a/src/App/Models/Page/VaultViewLoginPageModel.cs +++ b/src/App/Models/Page/VaultViewLoginPageModel.cs @@ -39,31 +39,9 @@ namespace Bit.App.Models.Page _username = value; PropertyChanged(this, new PropertyChangedEventArgs(nameof(Username))); PropertyChanged(this, new PropertyChangedEventArgs(nameof(ShowUsername))); - PropertyChanged(this, new PropertyChangedEventArgs(nameof(UsernameFontSize))); } } public bool ShowUsername => !string.IsNullOrWhiteSpace(Username); - public double UsernameFontSize - { - get - { - if(Device.RuntimePlatform == Device.Android) - { - var length = Username?.Length ?? 0; - - if(length > 35) - { - return Device.GetNamedSize(NamedSize.Micro, typeof(Label)); - } - else if(length > 25) - { - return Device.GetNamedSize(NamedSize.Small, typeof(Label)); - } - } - - return Device.GetNamedSize(NamedSize.Medium, typeof(Label)); - } - } public string Password { @@ -74,31 +52,9 @@ namespace Bit.App.Models.Page PropertyChanged(this, new PropertyChangedEventArgs(nameof(Password))); PropertyChanged(this, new PropertyChangedEventArgs(nameof(MaskedPassword))); PropertyChanged(this, new PropertyChangedEventArgs(nameof(ShowPassword))); - PropertyChanged(this, new PropertyChangedEventArgs(nameof(PasswordFontSize))); } } public bool ShowPassword => !string.IsNullOrWhiteSpace(Password); - public double PasswordFontSize - { - get - { - if(Device.RuntimePlatform == Device.Android) - { - var length = Password?.Length ?? 0; - - if(length > 25) - { - return Device.GetNamedSize(NamedSize.Micro, typeof(Label)); - } - else if(length > 20) - { - return Device.GetNamedSize(NamedSize.Small, typeof(Label)); - } - } - - return Device.GetNamedSize(NamedSize.Medium, typeof(Label)); - } - } public string Uri { diff --git a/src/App/Pages/Vault/VaultViewLoginPage.cs b/src/App/Pages/Vault/VaultViewLoginPage.cs index 78175f8f5..78b1e7e85 100644 --- a/src/App/Pages/Vault/VaultViewLoginPage.cs +++ b/src/App/Pages/Vault/VaultViewLoginPage.cs @@ -63,14 +63,13 @@ namespace Bit.App.Pages // Username UsernameCell = new LabeledValueCell(AppResources.Username, button1Text: AppResources.Copy); UsernameCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewLoginPageModel.Username)); - UsernameCell.Value.SetBinding(Label.FontSizeProperty, nameof(VaultViewLoginPageModel.UsernameFontSize)); UsernameCell.Button1.Command = new Command(() => Copy(Model.Username, AppResources.Username)); + UsernameCell.Value.LineBreakMode = LineBreakMode.WordWrap; // Password PasswordCell = new LabeledValueCell(AppResources.Password, button1Text: string.Empty, button2Text: AppResources.Copy); PasswordCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewLoginPageModel.MaskedPassword)); - PasswordCell.Value.SetBinding(Label.FontSizeProperty, nameof(VaultViewLoginPageModel.PasswordFontSize)); PasswordCell.Button1.SetBinding(Button.ImageProperty, nameof(VaultViewLoginPageModel.ShowHideImage)); if(Device.RuntimePlatform == Device.iOS) { @@ -79,6 +78,7 @@ namespace Bit.App.Pages PasswordCell.Button1.Command = new Command(() => Model.RevealPassword = !Model.RevealPassword); PasswordCell.Button2.Command = new Command(() => Copy(Model.Password, AppResources.Password)); PasswordCell.Value.FontFamily = Helpers.OnPlatform(iOS: "Courier", Android: "monospace", WinPhone: "Courier"); + PasswordCell.Value.LineBreakMode = LineBreakMode.WordWrap; // URI UriCell = new LabeledValueCell(AppResources.Website, button1Text: AppResources.Launch);