1
0
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:
Dinis Vieira
2023-10-16 00:47:52 +01:00
parent ce9503fa0c
commit 3cdf1c2f0e
9 changed files with 12 additions and 68 deletions

View File

@@ -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
}

View File

@@ -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
},