padding option for form entry cell. increased padding on login and register forms. reduced large font size on iOS

This commit is contained in:
Kyle Spearrin 2016-07-03 00:27:10 -04:00
parent 7e6dbecfe3
commit ec419a2306
6 changed files with 24 additions and 15 deletions

View File

@ -11,7 +11,8 @@ namespace Bit.App.Controls
bool IsPassword = false, bool IsPassword = false,
VisualElement nextElement = null, VisualElement nextElement = null,
bool useLabelAsPlaceholder = false, bool useLabelAsPlaceholder = false,
string imageSource = null) string imageSource = null,
Thickness? containerPadding = null)
{ {
if(!useLabelAsPlaceholder) if(!useLabelAsPlaceholder)
{ {
@ -48,7 +49,7 @@ namespace Bit.App.Controls
var imageStackLayout = new StackLayout var imageStackLayout = new StackLayout
{ {
Padding = new Thickness(15, 10), Padding = containerPadding ?? new Thickness(15, 10),
Orientation = StackOrientation.Horizontal, Orientation = StackOrientation.Horizontal,
Spacing = 10, Spacing = 10,
HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand,

View File

@ -51,8 +51,7 @@ namespace Bit.App.Pages
Command = new Command(async () => await RegisterAsync()), Command = new Command(async () => await RegisterAsync()),
VerticalOptions = LayoutOptions.End, VerticalOptions = LayoutOptions.End,
HorizontalOptions = LayoutOptions.Fill, HorizontalOptions = LayoutOptions.Fill,
Style = (Style)Application.Current.Resources["btn-primary"], Style = (Style)Application.Current.Resources["btn-primary"]
FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label))
}; };
var loginButton = new Button var loginButton = new Button
@ -61,8 +60,7 @@ namespace Bit.App.Pages
Command = new Command(async () => await LoginAsync()), Command = new Command(async () => await LoginAsync()),
VerticalOptions = LayoutOptions.End, VerticalOptions = LayoutOptions.End,
Style = (Style)Application.Current.Resources["btn-primaryAccent"], Style = (Style)Application.Current.Resources["btn-primaryAccent"],
HorizontalOptions = LayoutOptions.Fill, HorizontalOptions = LayoutOptions.Fill
FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label))
}; };
var buttonStackLayout = new StackLayout var buttonStackLayout = new StackLayout

View File

@ -38,10 +38,13 @@ namespace Bit.App.Pages
private void Init() private void Init()
{ {
var padding = new Thickness(15, 20);
PasswordCell = new FormEntryCell(AppResources.MasterPassword, IsPassword: true, PasswordCell = new FormEntryCell(AppResources.MasterPassword, IsPassword: true,
useLabelAsPlaceholder: true, imageSource: "lock"); useLabelAsPlaceholder: true, imageSource: "lock", containerPadding: padding);
EmailCell = new FormEntryCell(AppResources.EmailAddress, nextElement: PasswordCell.Entry, EmailCell = new FormEntryCell(AppResources.EmailAddress, nextElement: PasswordCell.Entry,
entryKeyboard: Keyboard.Email, useLabelAsPlaceholder: true, imageSource: "envelope"); entryKeyboard: Keyboard.Email, useLabelAsPlaceholder: true, imageSource: "envelope",
containerPadding: padding);
PasswordCell.Entry.ReturnType = Enums.ReturnType.Go; PasswordCell.Entry.ReturnType = Enums.ReturnType.Go;
PasswordCell.Entry.Completed += Entry_Completed; PasswordCell.Entry.Completed += Entry_Completed;

View File

@ -34,11 +34,18 @@ namespace Bit.App.Pages
private void Init() private void Init()
{ {
PasswordHintCell = new FormEntryCell("Master Password Hint (optional)", useLabelAsPlaceholder: true, imageSource: "lightbulb-o"); var padding = new Thickness(15, 20);
ConfirmPasswordCell = new FormEntryCell("Re-type Master Password", IsPassword: true, nextElement: PasswordHintCell.Entry, useLabelAsPlaceholder: true, imageSource: "lock");
PasswordCell = new FormEntryCell(AppResources.MasterPassword, IsPassword: true, nextElement: ConfirmPasswordCell.Entry, useLabelAsPlaceholder: true, imageSource: "lock"); PasswordHintCell = new FormEntryCell("Master Password Hint (optional)", useLabelAsPlaceholder: true,
NameCell = new FormEntryCell("Your Name", nextElement: PasswordCell.Entry, useLabelAsPlaceholder: true, imageSource: "user"); imageSource: "lightbulb-o", containerPadding: padding);
EmailCell = new FormEntryCell(AppResources.EmailAddress, nextElement: NameCell.Entry, entryKeyboard: Keyboard.Email, useLabelAsPlaceholder: true, imageSource: "envelope"); ConfirmPasswordCell = new FormEntryCell("Re-type Master Password", IsPassword: true,
nextElement: PasswordHintCell.Entry, useLabelAsPlaceholder: true, imageSource: "lock", containerPadding: padding);
PasswordCell = new FormEntryCell(AppResources.MasterPassword, IsPassword: true,
nextElement: ConfirmPasswordCell.Entry, useLabelAsPlaceholder: true, imageSource: "lock", containerPadding: padding);
NameCell = new FormEntryCell("Your Name", nextElement: PasswordCell.Entry,
useLabelAsPlaceholder: true, imageSource: "user", containerPadding: padding);
EmailCell = new FormEntryCell(AppResources.EmailAddress, nextElement: NameCell.Entry,
entryKeyboard: Keyboard.Email, useLabelAsPlaceholder: true, imageSource: "envelope", containerPadding: padding);
PasswordHintCell.Entry.ReturnType = Enums.ReturnType.Done; PasswordHintCell.Entry.ReturnType = Enums.ReturnType.Done;
PasswordHintCell.Entry.Completed += Entry_Completed; PasswordHintCell.Entry.Completed += Entry_Completed;

View File

@ -22,7 +22,7 @@ namespace Bit.iOS.Controls
var size = view.FontSize; var size = view.FontSize;
if(size == Device.GetNamedSize(NamedSize.Large, typeof(Button))) if(size == Device.GetNamedSize(NamedSize.Large, typeof(Button)))
{ {
pointSize *= 1.4f; pointSize *= 1.3f;
} }
else if(size == Device.GetNamedSize(NamedSize.Small, typeof(Button))) else if(size == Device.GetNamedSize(NamedSize.Small, typeof(Button)))
{ {

View File

@ -22,7 +22,7 @@ namespace Bit.iOS.Controls
var size = view.FontSize; var size = view.FontSize;
if(size == Device.GetNamedSize(NamedSize.Large, typeof(Label))) if(size == Device.GetNamedSize(NamedSize.Large, typeof(Label)))
{ {
pointSize *= 1.4f; pointSize *= 1.3f;
} }
else if(size == Device.GetNamedSize(NamedSize.Small, typeof(Label))) else if(size == Device.GetNamedSize(NamedSize.Small, typeof(Label)))
{ {