PM-3349 ToolbarHandler created for setting text on Android go back buttons.

This commit is contained in:
Dinis Vieira 2023-10-16 20:45:58 +01:00
parent 3cdf1c2f0e
commit 8c623a2067
No known key found for this signature in database
GPG key ID: 9389160FF6C295F3
2 changed files with 22 additions and 0 deletions

View file

@ -26,6 +26,7 @@
Bit.App.Handlers.StepperHandlerMappings.Setup(); Bit.App.Handlers.StepperHandlerMappings.Setup();
Bit.App.Handlers.TimePickerHandlerMappings.Setup(); Bit.App.Handlers.TimePickerHandlerMappings.Setup();
Bit.App.Handlers.ButtonHandlerMappings.Setup(); Bit.App.Handlers.ButtonHandlerMappings.Setup();
Bit.App.Handlers.ToolbarHandlerMappings.Setup();
handlers.AddHandler(typeof(Bit.App.Pages.TabsPage), typeof(Bit.App.Handlers.CustomTabbedPageHandler)); handlers.AddHandler(typeof(Bit.App.Pages.TabsPage), typeof(Bit.App.Handlers.CustomTabbedPageHandler));
#else #else

View file

@ -0,0 +1,21 @@
using Bit.Core.Resources.Localization;
using Microsoft.Maui.Handlers;
namespace Bit.App.Handlers
{
public class ToolbarHandlerMappings
{
public static void Setup()
{
ToolbarHandler.Mapper.AppendToMapping(nameof(IToolbar.BackButtonVisible), (handler, view) =>
{
handler.PlatformView.NavigationContentDescription = AppResources.TapToGoBack;
});
ToolbarHandler.Mapper.AppendToMapping(nameof(Toolbar.BackButtonTitle), (handler, view) =>
{
handler.PlatformView.NavigationContentDescription = AppResources.TapToGoBack;
});
}
}
}