Android style updates

This commit is contained in:
Kyle Spearrin 2016-08-18 20:20:18 -04:00
parent 4dfba13aea
commit 90a6855e39
5 changed files with 26 additions and 3 deletions

View file

@ -16,6 +16,7 @@ namespace Bit.Android.Controls
var view = (ExtendedPicker)Element; var view = (ExtendedPicker)Element;
Control.TextSize = (float)Device.GetNamedSize(NamedSize.Small, typeof(Picker));
SetBorder(view); SetBorder(view);
} }

View file

@ -12,16 +12,24 @@ namespace Bit.Android.Controls
{ {
public class ExtendedSwitchCellRenderer : SwitchCellRenderer public class ExtendedSwitchCellRenderer : SwitchCellRenderer
{ {
protected AView View { get; private set; } protected BaseCellView View { get; private set; }
protected override AView GetCellCore(Cell item, AView convertView, ViewGroup parent, Context context) protected override AView GetCellCore(Cell item, AView convertView, ViewGroup parent, Context context)
{ {
var View = base.GetCellCore(item, convertView, parent, context); var View = base.GetCellCore(item, convertView, parent, context) as SwitchCellView;
var extendedCell = (ExtendedSwitchCell)item; var extendedCell = (ExtendedSwitchCell)item;
if(View != null) if(View != null)
{ {
View.SetBackgroundColor(extendedCell.BackgroundColor.ToAndroid()); View.SetBackgroundColor(extendedCell.BackgroundColor.ToAndroid());
if(item.IsEnabled)
{
View.SetMainTextColor(Color.Black);
}
else
{
View.SetMainTextColor(Color.FromHex("d2d6de"));
}
} }
return View; return View;

View file

@ -27,6 +27,12 @@ namespace Bit.App.Controls
Tapped += FormEditorCell_Tapped; Tapped += FormEditorCell_Tapped;
if(Device.OS == TargetPlatform.Android)
{
Editor.FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label));
Editor.Margin = new Thickness(-4, -2, -4, -10);
}
View = stackLayout; View = stackLayout;
} }

View file

@ -38,6 +38,7 @@ namespace Bit.App.Controls
if(Device.OS == TargetPlatform.Android) if(Device.OS == TargetPlatform.Android)
{ {
stackLayout.Spacing = 0; stackLayout.Spacing = 0;
Picker.Margin = new Thickness(-4, -2, -4, -10);
} }
Tapped += FormPickerCell_Tapped; Tapped += FormPickerCell_Tapped;

View file

@ -41,9 +41,10 @@ namespace Bit.App.Pages
private void Init() private void Init()
{ {
var fingerprintName = Device.OnPlatform(iOS: "Touch ID", Android: "Fingerprint", WinPhone: "Fingerprint");
FingerprintCell = new ExtendedSwitchCell FingerprintCell = new ExtendedSwitchCell
{ {
Text = "Unlock with Touch ID" + (!_fingerprint.IsAvailable ? " (Unavilable)" : null), Text = "Unlock with " + fingerprintName + (!_fingerprint.IsAvailable ? " (Unavilable)" : null),
On = _settings.GetValueOrDefault<bool>(Constants.SettingFingerprintUnlockOn), On = _settings.GetValueOrDefault<bool>(Constants.SettingFingerprintUnlockOn),
IsEnabled = _fingerprint.IsAvailable IsEnabled = _fingerprint.IsAvailable
}; };
@ -428,6 +429,12 @@ namespace Bit.App.Pages
Padding = new Thickness(15) Padding = new Thickness(15)
}; };
if(Device.OS == TargetPlatform.Android)
{
labelDetailStackLayout.Spacing = 5;
Label.TextColor = Color.Black;
}
ShowDisclousure = true; ShowDisclousure = true;
View = labelDetailStackLayout; View = labelDetailStackLayout;
} }