mirror of
https://github.com/bitwarden/mobile
synced 2025-12-16 16:23:29 +00:00
PM-3349 PM-3350 MAUI Migration Initial
This commit is contained in:
35
src/iOS.Core/Handlers/EntryHandlerMappings.cs
Normal file
35
src/iOS.Core/Handlers/EntryHandlerMappings.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using Bit.iOS.Core.Utilities;
|
||||
using Microsoft.Maui.Handlers;
|
||||
using Microsoft.Maui.Platform;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Core.Handlers
|
||||
{
|
||||
public class EntryHandlerMappings
|
||||
{
|
||||
public static void Setup()
|
||||
{
|
||||
EntryHandler.Mapper.AppendToMapping("CustomEntryHandler", (handler, editor) =>
|
||||
{
|
||||
handler.PlatformView.ClearButtonMode = UITextFieldViewMode.WhileEditing;
|
||||
UpdateTintColor(handler, editor);
|
||||
iOSHelpers.SetBottomBorder(handler.PlatformView);
|
||||
// TODO: [Maui-Migration] Check if needed given that MAUI should be automatically change the font size based on OS accessbiility
|
||||
//UpdateFontSize();
|
||||
|
||||
if (!ThemeHelpers.LightTheme)
|
||||
{
|
||||
handler.PlatformView.KeyboardAppearance = UIKeyboardAppearance.Dark;
|
||||
}
|
||||
});
|
||||
|
||||
EntryHandler.Mapper.AppendToMapping(nameof(IEntry.TextColor), UpdateTintColor);
|
||||
}
|
||||
|
||||
private static void UpdateTintColor(IEntryHandler handler, IEntry editor)
|
||||
{
|
||||
handler.PlatformView.TintColor = editor.TextColor.ToPlatform();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user