feature: Android renderers
This commit is contained in:
28
Pixiview.Android/Renderers/OptionEntryRenderer.cs
Normal file
28
Pixiview.Android/Renderers/OptionEntryRenderer.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using Android.Content;
|
||||
using Android.Graphics.Drawables;
|
||||
using Pixiview.Droid.Renderers;
|
||||
using Pixiview.UI;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
[assembly: ExportRenderer(typeof(OptionEntry), typeof(OptionEntryRenderer))]
|
||||
namespace Pixiview.Droid.Renderers
|
||||
{
|
||||
public class OptionEntryRenderer : EntryRenderer
|
||||
{
|
||||
public OptionEntryRenderer(Context context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
|
||||
if (e.NewElement != null)
|
||||
{
|
||||
var drawable = new ColorDrawable(e.NewElement.BackgroundColor.ToAndroid());
|
||||
Control.SetBackground(drawable);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user