mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 18:08:26 +03:00
padding/margins for entry/picker
This commit is contained in:
parent
cf2ae9d7e8
commit
5dc4357078
3 changed files with 56 additions and 1 deletions
25
src/Android/Renderers/CustomEntryBarRenderer.cs
Normal file
25
src/Android/Renderers/CustomEntryBarRenderer.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
using Android.Content;
|
||||
using Bit.Droid.Renderers.BoxedView;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
[assembly: ExportRenderer(typeof(Entry), typeof(CustomEntryBarRenderer))]
|
||||
namespace Bit.Droid.Renderers.BoxedView
|
||||
{
|
||||
public class CustomEntryBarRenderer : EntryRenderer
|
||||
{
|
||||
public CustomEntryBarRenderer(Context context)
|
||||
: base(context)
|
||||
{ }
|
||||
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
if(Control != null && e.NewElement != null)
|
||||
{
|
||||
Control.SetPadding(Control.PaddingLeft, Control.PaddingTop - 10, Control.PaddingRight,
|
||||
Control.PaddingBottom + 20);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
25
src/Android/Renderers/CustomPickerBarRenderer.cs
Normal file
25
src/Android/Renderers/CustomPickerBarRenderer.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
using Android.Content;
|
||||
using Bit.Droid.Renderers.BoxedView;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
[assembly: ExportRenderer(typeof(Picker), typeof(CustomPickerBarRenderer))]
|
||||
namespace Bit.Droid.Renderers.BoxedView
|
||||
{
|
||||
public class CustomPickerBarRenderer : PickerRenderer
|
||||
{
|
||||
public CustomPickerBarRenderer(Context context)
|
||||
: base(context)
|
||||
{ }
|
||||
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<Picker> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
if(Control != null && e.NewElement != null)
|
||||
{
|
||||
Control.SetPadding(Control.PaddingLeft, Control.PaddingTop - 10, Control.PaddingRight,
|
||||
Control.PaddingBottom + 20);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,7 +5,12 @@
|
|||
<Style TargetType="Entry"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="Margin"
|
||||
Value="-4, 0" />
|
||||
Value="-4, 0, -4, -4" />
|
||||
</Style>
|
||||
<Style TargetType="Picker"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="Margin"
|
||||
Value="-4, 0, -4, -4" />
|
||||
</Style>
|
||||
|
||||
<!-- Buttons -->
|
||||
|
|
Loading…
Reference in a new issue