TabBarEffect removed and it's behavior is now taken care of by CustomTabbedPageHandler

This commit is contained in:
Dinis Vieira 2023-10-01 22:32:37 +01:00
parent 8b7f9b9fb3
commit 9f6c8601d3
No known key found for this signature in database
GPG key ID: 9389160FF6C295F3
4 changed files with 2 additions and 37 deletions

View file

@ -1,4 +1,5 @@
using AndroidX.AppCompat.View.Menu; using AndroidX.AppCompat.View.Menu;
using AndroidX.Navigation.UI;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using Google.Android.Material.BottomNavigation; using Google.Android.Material.BottomNavigation;
@ -68,6 +69,7 @@ namespace Bit.App.Handlers
} }
_bottomNavigationView = bottomNavigationView; _bottomNavigationView = bottomNavigationView;
_bottomNavigationView.LabelVisibilityMode = LabelVisibilityMode.LabelVisibilityLabeled;
_bottomNavigationView.ItemReselected += BottomNavigationView_ItemReselected; _bottomNavigationView.ItemReselected += BottomNavigationView_ItemReselected;
} }
} }

View file

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

View file

@ -25,7 +25,6 @@ public static class MauiProgram
#if ANDROID #if ANDROID
effects.Add<AppEffects.FixedSizeEffect, AppEffects.FixedSizePlatformEffect>(); effects.Add<AppEffects.FixedSizeEffect, AppEffects.FixedSizePlatformEffect>();
effects.Add<AppEffects.NoEmojiKeyboardEffect, AppEffects.NoEmojiKeyboardPlatformEffect>(); effects.Add<AppEffects.NoEmojiKeyboardEffect, AppEffects.NoEmojiKeyboardPlatformEffect>();
effects.Add<AppEffects.TabBarEffect, AppEffects.TabBarPlatformEffect>();
effects.Add<AppEffects.RemoveFontPaddingEffect, AppEffects.RemoveFontPaddingPlatformEffect>(); effects.Add<AppEffects.RemoveFontPaddingEffect, AppEffects.RemoveFontPaddingPlatformEffect>();
#endif #endif
customEffectsBuilder?.Invoke(effects); customEffectsBuilder?.Invoke(effects);

View file

@ -58,8 +58,6 @@ namespace Bit.App.Pages
if (DeviceInfo.Platform == DevicePlatform.Android) if (DeviceInfo.Platform == DevicePlatform.Android)
{ {
Effects.Add(new TabBarEffect());
Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.TabbedPage.SetToolbarPlacement(this, Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.TabbedPage.SetToolbarPlacement(this,
Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.ToolbarPlacement.Bottom); Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.ToolbarPlacement.Bottom);
Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.TabbedPage.SetIsSwipePagingEnabled(this, false); Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.TabbedPage.SetIsSwipePagingEnabled(this, false);