mirror of
https://github.com/bitwarden/android.git
synced 2024-12-28 03:48:31 +03: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:
parent
ce9503fa0c
commit
3cdf1c2f0e
9 changed files with 12 additions and 68 deletions
|
@ -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(
|
return Core.MauiProgram.ConfigureMauiAppBuilder(
|
||||||
effects =>
|
effects =>
|
||||||
{
|
{
|
||||||
#if ANDROID
|
#if IOS
|
||||||
effects.Add<Effects.FabShadowEffect, Effects.FabShadowPlatformEffect>();
|
|
||||||
#else
|
|
||||||
iOS.Core.Utilities.iOSCoreHelpers.ConfigureMAUIEffects(effects);
|
iOS.Core.Utilities.iOSCoreHelpers.ConfigureMAUIEffects(effects);
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
namespace Bit.App.Effects
|
|
||||||
{
|
|
||||||
public class FabShadowEffect : RoutingEffect
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -166,11 +166,7 @@
|
||||||
AbsoluteLayout.LayoutFlags="PositionProportional"
|
AbsoluteLayout.LayoutFlags="PositionProportional"
|
||||||
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"
|
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"
|
||||||
AutomationProperties.IsInAccessibleTree="True"
|
AutomationProperties.IsInAccessibleTree="True"
|
||||||
SemanticProperties.Description="{u:I18n AddItem}">
|
SemanticProperties.Description="{u:I18n AddItem}"/>
|
||||||
<Button.Effects>
|
|
||||||
<effects:FabShadowEffect />
|
|
||||||
</Button.Effects>
|
|
||||||
</Button>
|
|
||||||
</AbsoluteLayout>
|
</AbsoluteLayout>
|
||||||
|
|
||||||
</pages:BaseContentPage>
|
</pages:BaseContentPage>
|
|
@ -76,11 +76,7 @@
|
||||||
AbsoluteLayout.LayoutFlags="PositionProportional"
|
AbsoluteLayout.LayoutFlags="PositionProportional"
|
||||||
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"
|
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"
|
||||||
AutomationProperties.IsInAccessibleTree="True"
|
AutomationProperties.IsInAccessibleTree="True"
|
||||||
SemanticProperties.Description="{u:I18n AddFolder}">
|
SemanticProperties.Description="{u:I18n AddFolder}"/>
|
||||||
<Button.Effects>
|
|
||||||
<effects:FabShadowEffect />
|
|
||||||
</Button.Effects>
|
|
||||||
</Button>
|
|
||||||
</AbsoluteLayout>
|
</AbsoluteLayout>
|
||||||
|
|
||||||
</pages:BaseContentPage>
|
</pages:BaseContentPage>
|
||||||
|
|
|
@ -755,11 +755,7 @@
|
||||||
AutomationProperties.IsInAccessibleTree="True"
|
AutomationProperties.IsInAccessibleTree="True"
|
||||||
SemanticProperties.Description="{u:I18n EditItem}"
|
SemanticProperties.Description="{u:I18n EditItem}"
|
||||||
AutomationId="CipherEditButton"
|
AutomationId="CipherEditButton"
|
||||||
IsVisible="{Binding CanEdit}">
|
IsVisible="{Binding CanEdit}"/>
|
||||||
<Button.Effects>
|
|
||||||
<effects:FabShadowEffect />
|
|
||||||
</Button.Effects>
|
|
||||||
</Button>
|
|
||||||
</AbsoluteLayout>
|
</AbsoluteLayout>
|
||||||
|
|
||||||
</pages:BaseContentPage>
|
</pages:BaseContentPage>
|
|
@ -142,11 +142,7 @@
|
||||||
Style="{StaticResource btn-fab}"
|
Style="{StaticResource btn-fab}"
|
||||||
IsVisible="{OnPlatform iOS=false, Android=true}"
|
IsVisible="{OnPlatform iOS=false, Android=true}"
|
||||||
AbsoluteLayout.LayoutFlags="PositionProportional"
|
AbsoluteLayout.LayoutFlags="PositionProportional"
|
||||||
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize">
|
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"/>
|
||||||
<Button.Effects>
|
|
||||||
<effects:FabShadowEffect />
|
|
||||||
</Button.Effects>
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
<controls:AccountSwitchingOverlayView
|
<controls:AccountSwitchingOverlayView
|
||||||
x:Name="_accountListOverlay"
|
x:Name="_accountListOverlay"
|
||||||
|
|
|
@ -197,11 +197,7 @@
|
||||||
AbsoluteLayout.LayoutFlags="PositionProportional"
|
AbsoluteLayout.LayoutFlags="PositionProportional"
|
||||||
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"
|
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"
|
||||||
AutomationProperties.IsInAccessibleTree="True"
|
AutomationProperties.IsInAccessibleTree="True"
|
||||||
SemanticProperties.Description="{u:I18n AddItem}">
|
SemanticProperties.Description="{u:I18n AddItem}"/>
|
||||||
<Button.Effects>
|
|
||||||
<effects:FabShadowEffect />
|
|
||||||
</Button.Effects>
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
<controls:AccountSwitchingOverlayView
|
<controls:AccountSwitchingOverlayView
|
||||||
x:Name="_accountListOverlay"
|
x:Name="_accountListOverlay"
|
||||||
|
|
|
@ -130,6 +130,12 @@
|
||||||
Value="100" />
|
Value="100" />
|
||||||
<Setter Property="BackgroundColor"
|
<Setter Property="BackgroundColor"
|
||||||
Value="{DynamicResource FabColor}" />
|
Value="{DynamicResource FabColor}" />
|
||||||
|
<Setter Property="Shadow">
|
||||||
|
<Shadow Brush="Black"
|
||||||
|
Offset="1,2"
|
||||||
|
Radius="5"
|
||||||
|
Opacity="0.1" />
|
||||||
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style TargetType="controls:IconLabelButton"
|
<Style TargetType="controls:IconLabelButton"
|
||||||
|
|
Loading…
Reference in a new issue