Android UI updates to custom cells

This commit is contained in:
Kyle Spearrin 2016-08-14 00:54:07 -04:00
parent de244efbf9
commit 2180fb6728
3 changed files with 34 additions and 20 deletions

View File

@ -20,7 +20,6 @@ namespace Bit.App.Controls
{
Text = labelText,
FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
VerticalOptions = LayoutOptions.Start,
Style = (Style)Application.Current.Resources["text-muted"],
HorizontalOptions = LayoutOptions.FillAndExpand
};
@ -35,18 +34,11 @@ namespace Bit.App.Controls
{
Keyboard = entryKeyboard,
HasBorder = false,
VerticalOptions = LayoutOptions.CenterAndExpand,
IsPassword = IsPassword,
AllowClear = true,
HorizontalOptions = LayoutOptions.FillAndExpand
};
if(Device.OS == TargetPlatform.Android)
{
Entry.FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label));
Entry.TextColor = Color.Black;
}
if(useLabelAsPlaceholder)
{
Entry.Placeholder = labelText;
@ -86,8 +78,16 @@ namespace Bit.App.Controls
var formStackLayout = new StackLayout
{
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand
VerticalOptions = LayoutOptions.CenterAndExpand
};
if(Device.OS == TargetPlatform.Android)
{
Entry.FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label));
Entry.TextColor = Color.Black;
formStackLayout.Spacing = 0;
}
if(!useLabelAsPlaceholder)
{
formStackLayout.Children.Add(Label);

View File

@ -12,14 +12,12 @@ namespace Bit.App.Controls
{
Text = labelText,
FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
TextColor = Color.FromHex("777777"),
VerticalOptions = LayoutOptions.Start
TextColor = Color.FromHex("777777")
};
Picker = new ExtendedPicker
{
HasBorder = false,
VerticalOptions = LayoutOptions.CenterAndExpand
HasBorder = false
};
foreach(var item in pickerItems)
@ -30,12 +28,19 @@ namespace Bit.App.Controls
var stackLayout = new StackLayout
{
Padding = new Thickness(15, 10)
Padding = new Thickness(15, 10),
VerticalOptions = LayoutOptions.CenterAndExpand
};
stackLayout.Children.Add(Label);
stackLayout.Children.Add(Picker);
if(Device.OS == TargetPlatform.Android)
{
Label.FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label));
stackLayout.Spacing = 0;
}
Tapped += FormPickerCell_Tapped;
View = stackLayout;

View File

@ -19,7 +19,7 @@ namespace Bit.App.Controls
var labelValueStackLayout = new StackLayout
{
HorizontalOptions = LayoutOptions.StartAndExpand,
VerticalOptions = LayoutOptions.Center
VerticalOptions = LayoutOptions.CenterAndExpand
};
if(labelText != null)
@ -28,10 +28,14 @@ namespace Bit.App.Controls
{
Text = labelText,
FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
Style = (Style)Application.Current.Resources["text-muted"],
VerticalOptions = LayoutOptions.Start
Style = (Style)Application.Current.Resources["text-muted"]
};
if(Device.OS == TargetPlatform.Android)
{
Label.FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label));
}
labelValueStackLayout.Children.Add(Label);
}
@ -39,17 +43,22 @@ namespace Bit.App.Controls
{
Text = valueText,
FontSize = Device.GetNamedSize(NamedSize.Default, typeof(Label)),
LineBreakMode = LineBreakMode.TailTruncation,
VerticalOptions = LayoutOptions.CenterAndExpand
LineBreakMode = LineBreakMode.TailTruncation
};
if(Device.OS == TargetPlatform.Android)
{
Value.TextColor = Color.Black;
}
labelValueStackLayout.Children.Add(Value);
containerStackLayout.Children.Add(labelValueStackLayout);
var buttonStackLayout = new StackLayout
{
Orientation = StackOrientation.Horizontal
Orientation = StackOrientation.Horizontal,
VerticalOptions = LayoutOptions.CenterAndExpand
};
if(button1Text != null)