1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-22 19:23:58 +00:00

Move to named sizes

This commit is contained in:
Kyle Spearrin
2016-06-27 20:56:59 -04:00
parent 275246f27b
commit 54da129887
12 changed files with 45 additions and 31 deletions

View File

@@ -5,15 +5,18 @@ namespace Bit.App.Controls
{
public class FormEntryCell : ExtendedViewCell
{
public FormEntryCell(string labelText, Keyboard entryKeyboard = null, bool IsPassword = false, VisualElement nextElement = null)
public FormEntryCell(string labelText, Keyboard entryKeyboard = null, bool IsPassword = false, VisualElement nextElement = null, bool useLabelAsPlaceholder = false)
{
Label = new Label
if(!useLabelAsPlaceholder)
{
Text = labelText,
FontSize = 14,
VerticalOptions = LayoutOptions.Start,
Style = (Style)Application.Current.Resources["text-muted"]
};
Label = new Label
{
Text = labelText,
FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
VerticalOptions = LayoutOptions.Start,
Style = (Style)Application.Current.Resources["text-muted"]
};
}
Entry = new ExtendedEntry
{
@@ -23,6 +26,11 @@ namespace Bit.App.Controls
IsPassword = IsPassword
};
if(useLabelAsPlaceholder)
{
Entry.Placeholder = labelText;
}
if(nextElement != null)
{
Entry.ReturnType = Enums.ReturnType.Next;
@@ -34,7 +42,11 @@ namespace Bit.App.Controls
Padding = new Thickness(15, 10)
};
stackLayout.Children.Add(Label);
if(!useLabelAsPlaceholder)
{
stackLayout.Children.Add(Label);
}
stackLayout.Children.Add(Entry);
View = stackLayout;