mirror of
https://github.com/bitwarden/mobile
synced 2026-01-11 04:53:52 +00:00
PM-3349 Replaced the FabShadowEffect with the new MAUI Shadow to fix the buggy shadows on the Android Fab Button.
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
using Microsoft.Maui.Controls;
|
||||
using Microsoft.Maui;
|
||||
using Microsoft.Maui.Controls.Platform;
|
||||
|
||||
#if ANDROID
|
||||
using Android.Graphics.Drawables;
|
||||
using Bit.App.Droid.Utilities;
|
||||
#endif
|
||||
|
||||
namespace Bit.App.Effects
|
||||
{
|
||||
#if ANDROID
|
||||
public class FabShadowPlatformEffect : PlatformEffect
|
||||
{
|
||||
protected override void OnAttached()
|
||||
{
|
||||
if (Control is Android.Widget.Button button)
|
||||
{
|
||||
var gd = new GradientDrawable();
|
||||
gd.SetColor(ThemeHelpers.FabColor);
|
||||
gd.SetCornerRadius(100);
|
||||
|
||||
button.SetBackground(gd);
|
||||
button.Elevation = 6;
|
||||
button.TranslationZ = 20;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnDetached()
|
||||
{
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -7,9 +7,7 @@
|
||||
return Core.MauiProgram.ConfigureMauiAppBuilder(
|
||||
effects =>
|
||||
{
|
||||
#if ANDROID
|
||||
effects.Add<Effects.FabShadowEffect, Effects.FabShadowPlatformEffect>();
|
||||
#else
|
||||
#if IOS
|
||||
iOS.Core.Utilities.iOSCoreHelpers.ConfigureMAUIEffects(effects);
|
||||
#endif
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user