mirror of
https://github.com/bitwarden/mobile.git
synced 2024-12-17 15:27:43 +01:00
padding/margins for entry/picker
This commit is contained in:
parent
cf2ae9d7e8
commit
5dc4357078
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"
|
<Style TargetType="Entry"
|
||||||
ApplyToDerivedTypes="True">
|
ApplyToDerivedTypes="True">
|
||||||
<Setter Property="Margin"
|
<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>
|
</Style>
|
||||||
|
|
||||||
<!-- Buttons -->
|
<!-- Buttons -->
|
||||||
|
Loading…
Reference in New Issue
Block a user