From 3cdf1c2f0e1cfa2ed7f4052ce5f3eca7d7f35943 Mon Sep 17 00:00:00 2001 From: Dinis Vieira Date: Mon, 16 Oct 2023 00:47:52 +0100 Subject: [PATCH] PM-3349 Replaced the FabShadowEffect with the new MAUI Shadow to fix the buggy shadows on the Android Fab Button. --- src/App/Effects/FabShadowEffect.cs | 34 ------------------- src/App/MauiProgram.cs | 4 +-- src/Core/Effects/FabShadowEffect.cs | 6 ---- .../SendGroupingsPage/SendGroupingsPage.xaml | 6 +--- src/Core/Pages/Settings/FoldersPage.xaml | 6 +--- src/Core/Pages/Vault/CipherDetailsPage.xaml | 6 +--- src/Core/Pages/Vault/CipherSelectionPage.xaml | 6 +--- .../Vault/GroupingsPage/GroupingsPage.xaml | 6 +--- src/Core/Resources/Styles/Base.xaml | 6 ++++ 9 files changed, 12 insertions(+), 68 deletions(-) delete mode 100644 src/App/Effects/FabShadowEffect.cs delete mode 100755 src/Core/Effects/FabShadowEffect.cs diff --git a/src/App/Effects/FabShadowEffect.cs b/src/App/Effects/FabShadowEffect.cs deleted file mode 100644 index 344505ea1..000000000 --- a/src/App/Effects/FabShadowEffect.cs +++ /dev/null @@ -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 -} diff --git a/src/App/MauiProgram.cs b/src/App/MauiProgram.cs index 1f9a876b3..85c1ed0f8 100644 --- a/src/App/MauiProgram.cs +++ b/src/App/MauiProgram.cs @@ -7,9 +7,7 @@ return Core.MauiProgram.ConfigureMauiAppBuilder( effects => { -#if ANDROID - effects.Add(); -#else +#if IOS iOS.Core.Utilities.iOSCoreHelpers.ConfigureMAUIEffects(effects); #endif }, diff --git a/src/Core/Effects/FabShadowEffect.cs b/src/Core/Effects/FabShadowEffect.cs deleted file mode 100755 index 6cc62ceca..000000000 --- a/src/Core/Effects/FabShadowEffect.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Bit.App.Effects -{ - public class FabShadowEffect : RoutingEffect - { - } -} diff --git a/src/Core/Pages/Send/SendGroupingsPage/SendGroupingsPage.xaml b/src/Core/Pages/Send/SendGroupingsPage/SendGroupingsPage.xaml index 7eec129a6..48cdabfaa 100644 --- a/src/Core/Pages/Send/SendGroupingsPage/SendGroupingsPage.xaml +++ b/src/Core/Pages/Send/SendGroupingsPage/SendGroupingsPage.xaml @@ -166,11 +166,7 @@ AbsoluteLayout.LayoutFlags="PositionProportional" AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize" AutomationProperties.IsInAccessibleTree="True" - SemanticProperties.Description="{u:I18n AddItem}"> - - - - + SemanticProperties.Description="{u:I18n AddItem}"/> \ No newline at end of file diff --git a/src/Core/Pages/Settings/FoldersPage.xaml b/src/Core/Pages/Settings/FoldersPage.xaml index abe9c4fc3..19873ad1f 100644 --- a/src/Core/Pages/Settings/FoldersPage.xaml +++ b/src/Core/Pages/Settings/FoldersPage.xaml @@ -76,11 +76,7 @@ AbsoluteLayout.LayoutFlags="PositionProportional" AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize" AutomationProperties.IsInAccessibleTree="True" - SemanticProperties.Description="{u:I18n AddFolder}"> - - - - + SemanticProperties.Description="{u:I18n AddFolder}"/> diff --git a/src/Core/Pages/Vault/CipherDetailsPage.xaml b/src/Core/Pages/Vault/CipherDetailsPage.xaml index 602735fca..545491fe2 100644 --- a/src/Core/Pages/Vault/CipherDetailsPage.xaml +++ b/src/Core/Pages/Vault/CipherDetailsPage.xaml @@ -755,11 +755,7 @@ AutomationProperties.IsInAccessibleTree="True" SemanticProperties.Description="{u:I18n EditItem}" AutomationId="CipherEditButton" - IsVisible="{Binding CanEdit}"> - - - - + IsVisible="{Binding CanEdit}"/> \ No newline at end of file diff --git a/src/Core/Pages/Vault/CipherSelectionPage.xaml b/src/Core/Pages/Vault/CipherSelectionPage.xaml index 26ce14227..1f73e4318 100644 --- a/src/Core/Pages/Vault/CipherSelectionPage.xaml +++ b/src/Core/Pages/Vault/CipherSelectionPage.xaml @@ -142,11 +142,7 @@ Style="{StaticResource btn-fab}" IsVisible="{OnPlatform iOS=false, Android=true}" AbsoluteLayout.LayoutFlags="PositionProportional" - AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"> - - - - + AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"/> - - - - + SemanticProperties.Description="{u:I18n AddItem}"/> + + +