bitwarden-android/src/Android/Renderers/CustomEntryRenderer.cs

29 lines
943 B
C#
Raw Normal View History

2019-05-08 06:22:25 +03:00
using Android.Content;
using Android.Views.InputMethods;
2019-05-13 22:25:20 +03:00
using Bit.Droid.Renderers;
2019-05-08 06:22:25 +03:00
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
2019-05-08 22:00:45 +03:00
[assembly: ExportRenderer(typeof(Entry), typeof(CustomEntryRenderer))]
2019-05-13 22:25:20 +03:00
namespace Bit.Droid.Renderers
2019-05-08 06:22:25 +03:00
{
2019-05-08 22:00:45 +03:00
public class CustomEntryRenderer : EntryRenderer
2019-05-08 06:22:25 +03:00
{
2019-05-08 22:00:45 +03:00
public CustomEntryRenderer(Context context)
2019-05-08 06:22:25 +03:00
: 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);
2019-06-04 00:23:50 +03:00
Control.ImeOptions = Control.ImeOptions | (ImeAction)ImeFlags.NoPersonalizedLearning |
(ImeAction)ImeFlags.NoExtractUi;
2019-05-08 06:22:25 +03:00
}
}
}
}