From a7ba21f2f91949509b789dc47bc658d93dea5c63 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 23 Aug 2016 23:15:28 -0400 Subject: [PATCH] Implemented specific entry padding for android api 21. --- src/App/Controls/FormEntryCell.cs | 23 ++++++++++++++++++++--- src/App/Controls/PinControl.cs | 5 +++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/App/Controls/FormEntryCell.cs b/src/App/Controls/FormEntryCell.cs index a6575cb9a..feb488cf6 100644 --- a/src/App/Controls/FormEntryCell.cs +++ b/src/App/Controls/FormEntryCell.cs @@ -1,5 +1,7 @@ -using System; +using Bit.App.Abstractions; +using System; using Xamarin.Forms; +using XLabs.Ioc; namespace Bit.App.Controls { @@ -79,9 +81,24 @@ namespace Bit.App.Controls if(Device.OS == TargetPlatform.Android) { - if(!useLabelAsPlaceholder) + var deviceInfo = Resolver.Resolve(); + if(useLabelAsPlaceholder) { - Entry.Margin = new Thickness(-4, -7, -4, -11); + if(deviceInfo.Version == 21) + { + Entry.Margin = new Thickness(0, 4, 0, -4); + } + } + else + { + if(deviceInfo.Version == 21) + { + Entry.Margin = new Thickness(-4, -2, -4, -11); + } + else + { + Entry.Margin = new Thickness(-4, -7, -4, -11); + } } } diff --git a/src/App/Controls/PinControl.cs b/src/App/Controls/PinControl.cs index a9bef5481..ce3e60d91 100644 --- a/src/App/Controls/PinControl.cs +++ b/src/App/Controls/PinControl.cs @@ -23,6 +23,11 @@ namespace Bit.App.Controls Margin = new Thickness(0, int.MaxValue, 0, 0) }; Entry.TextChanged += Entry_TextChanged; + + if(Device.OS == TargetPlatform.Android) + { + Label.TextColor = Color.Black; + } } private void Entry_TextChanged(object sender, TextChangedEventArgs e)