From 9f6c8601d3bbaee63ec445b3bc763d4d99e37110 Mon Sep 17 00:00:00 2001 From: Dinis Vieira Date: Sun, 1 Oct 2023 22:32:37 +0100 Subject: [PATCH] TabBarEffect removed and it's behavior is now taken care of by CustomTabbedPageHandler --- .../Handlers/CustomTabbedPageHandler.cs | 2 ++ src/Core/Effects/TabBarEffect.cs | 34 ------------------- src/Core/MauiProgram.cs | 1 - src/Core/Pages/TabsPage.cs | 2 -- 4 files changed, 2 insertions(+), 37 deletions(-) delete mode 100755 src/Core/Effects/TabBarEffect.cs diff --git a/src/App/Platforms/Android/Handlers/CustomTabbedPageHandler.cs b/src/App/Platforms/Android/Handlers/CustomTabbedPageHandler.cs index ddd72b638..930922484 100644 --- a/src/App/Platforms/Android/Handlers/CustomTabbedPageHandler.cs +++ b/src/App/Platforms/Android/Handlers/CustomTabbedPageHandler.cs @@ -1,4 +1,5 @@ using AndroidX.AppCompat.View.Menu; +using AndroidX.Navigation.UI; using Bit.Core.Abstractions; using Bit.Core.Utilities; using Google.Android.Material.BottomNavigation; @@ -68,6 +69,7 @@ namespace Bit.App.Handlers } _bottomNavigationView = bottomNavigationView; + _bottomNavigationView.LabelVisibilityMode = LabelVisibilityMode.LabelVisibilityLabeled; _bottomNavigationView.ItemReselected += BottomNavigationView_ItemReselected; } } diff --git a/src/Core/Effects/TabBarEffect.cs b/src/Core/Effects/TabBarEffect.cs deleted file mode 100755 index 41998e844..000000000 --- a/src/Core/Effects/TabBarEffect.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.Maui.Controls; -using Microsoft.Maui; -using Microsoft.Maui.Controls.Platform; - -namespace Bit.App.Effects -{ - public class TabBarEffect : RoutingEffect - { - } - -#if ANDROID - public class TabBarPlatformEffect : PlatformEffect - { - protected override void OnAttached() - { - // TODO: [MAUI-Migration] [Critical] - // now Container is View instead of ViewGroup, let's review this - //if (!(Container.GetChildAt(0) is ViewGroup layout)) - //{ - // return; - //} - //if (!(layout.GetChildAt(1) is BottomNavigationView bottomNavigationView)) - //{ - // return; - //} - //bottomNavigationView.LabelVisibilityMode = LabelVisibilityMode.LabelVisibilityLabeled; - } - - protected override void OnDetached() - { - } - } -#endif -} diff --git a/src/Core/MauiProgram.cs b/src/Core/MauiProgram.cs index 224b42a25..ac52f30b8 100644 --- a/src/Core/MauiProgram.cs +++ b/src/Core/MauiProgram.cs @@ -25,7 +25,6 @@ public static class MauiProgram #if ANDROID effects.Add(); effects.Add(); - effects.Add(); effects.Add(); #endif customEffectsBuilder?.Invoke(effects); diff --git a/src/Core/Pages/TabsPage.cs b/src/Core/Pages/TabsPage.cs index f14917a70..036748523 100644 --- a/src/Core/Pages/TabsPage.cs +++ b/src/Core/Pages/TabsPage.cs @@ -58,8 +58,6 @@ namespace Bit.App.Pages if (DeviceInfo.Platform == DevicePlatform.Android) { - Effects.Add(new TabBarEffect()); - Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.TabbedPage.SetToolbarPlacement(this, Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.ToolbarPlacement.Bottom); Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.TabbedPage.SetIsSwipePagingEnabled(this, false);