1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-26 12:16:07 +01: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
No known key found for this signature in database
GPG Key ID: 9389160FF6C295F3
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
},

View File

@ -1,6 +0,0 @@
namespace Bit.App.Effects
{
public class FabShadowEffect : RoutingEffect
{
}
}

View File

@ -166,11 +166,7 @@
AbsoluteLayout.LayoutFlags="PositionProportional"
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"
AutomationProperties.IsInAccessibleTree="True"
SemanticProperties.Description="{u:I18n AddItem}">
<Button.Effects>
<effects:FabShadowEffect />
</Button.Effects>
</Button>
SemanticProperties.Description="{u:I18n AddItem}"/>
</AbsoluteLayout>
</pages:BaseContentPage>

View File

@ -76,11 +76,7 @@
AbsoluteLayout.LayoutFlags="PositionProportional"
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"
AutomationProperties.IsInAccessibleTree="True"
SemanticProperties.Description="{u:I18n AddFolder}">
<Button.Effects>
<effects:FabShadowEffect />
</Button.Effects>
</Button>
SemanticProperties.Description="{u:I18n AddFolder}"/>
</AbsoluteLayout>
</pages:BaseContentPage>

View File

@ -755,11 +755,7 @@
AutomationProperties.IsInAccessibleTree="True"
SemanticProperties.Description="{u:I18n EditItem}"
AutomationId="CipherEditButton"
IsVisible="{Binding CanEdit}">
<Button.Effects>
<effects:FabShadowEffect />
</Button.Effects>
</Button>
IsVisible="{Binding CanEdit}"/>
</AbsoluteLayout>
</pages:BaseContentPage>

View File

@ -142,11 +142,7 @@
Style="{StaticResource btn-fab}"
IsVisible="{OnPlatform iOS=false, Android=true}"
AbsoluteLayout.LayoutFlags="PositionProportional"
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize">
<Button.Effects>
<effects:FabShadowEffect />
</Button.Effects>
</Button>
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"/>
<controls:AccountSwitchingOverlayView
x:Name="_accountListOverlay"

View File

@ -197,11 +197,7 @@
AbsoluteLayout.LayoutFlags="PositionProportional"
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"
AutomationProperties.IsInAccessibleTree="True"
SemanticProperties.Description="{u:I18n AddItem}">
<Button.Effects>
<effects:FabShadowEffect />
</Button.Effects>
</Button>
SemanticProperties.Description="{u:I18n AddItem}"/>
<controls:AccountSwitchingOverlayView
x:Name="_accountListOverlay"

View File

@ -130,6 +130,12 @@
Value="100" />
<Setter Property="BackgroundColor"
Value="{DynamicResource FabColor}" />
<Setter Property="Shadow">
<Shadow Brush="Black"
Offset="1,2"
Radius="5"
Opacity="0.1" />
</Setter>
</Style>
<Style TargetType="controls:IconLabelButton"