2020-03-20 22:54:23 +01:00
|
|
|
|
using Android.Graphics.Drawables;
|
|
|
|
|
using Bit.Droid.Effects;
|
|
|
|
|
using Xamarin.Forms;
|
|
|
|
|
using Xamarin.Forms.Platform.Android;
|
|
|
|
|
|
|
|
|
|
[assembly: ExportEffect(typeof(FabShadowEffect), "FabShadowEffect")]
|
|
|
|
|
namespace Bit.Droid.Effects
|
|
|
|
|
{
|
|
|
|
|
public class FabShadowEffect : PlatformEffect
|
|
|
|
|
{
|
|
|
|
|
protected override void OnAttached ()
|
|
|
|
|
{
|
2020-03-28 14:16:28 +01:00
|
|
|
|
if (Control is Android.Widget.Button button)
|
2020-03-20 22:54:23 +01:00
|
|
|
|
{
|
|
|
|
|
var gd = new GradientDrawable();
|
|
|
|
|
gd.SetColor(((Color)Application.Current.Resources["FabColor"]).ToAndroid());
|
|
|
|
|
gd.SetCornerRadius(100);
|
|
|
|
|
|
|
|
|
|
button.SetBackground(gd);
|
|
|
|
|
button.Elevation = 6;
|
|
|
|
|
button.TranslationZ = 20;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnDetached ()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|