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

View file

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

View file

@ -38,10 +38,13 @@ namespace Bit.App.Pages
private void Init()
{
var padding = new Thickness(15, 20);
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,
entryKeyboard: Keyboard.Email, useLabelAsPlaceholder: true, imageSource: "envelope");
entryKeyboard: Keyboard.Email, useLabelAsPlaceholder: true, imageSource: "envelope",
containerPadding: padding);
PasswordCell.Entry.ReturnType = Enums.ReturnType.Go;
PasswordCell.Entry.Completed += Entry_Completed;

View file

@ -34,11 +34,18 @@ namespace Bit.App.Pages
private void Init()
{
PasswordHintCell = new FormEntryCell("Master Password Hint (optional)", useLabelAsPlaceholder: true, imageSource: "lightbulb-o");
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");
NameCell = new FormEntryCell("Your Name", nextElement: PasswordCell.Entry, useLabelAsPlaceholder: true, imageSource: "user");
EmailCell = new FormEntryCell(AppResources.EmailAddress, nextElement: NameCell.Entry, entryKeyboard: Keyboard.Email, useLabelAsPlaceholder: true, imageSource: "envelope");
var padding = new Thickness(15, 20);
PasswordHintCell = new FormEntryCell("Master Password Hint (optional)", useLabelAsPlaceholder: true,
imageSource: "lightbulb-o", containerPadding: padding);
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.Completed += Entry_Completed;

View file

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

View file

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