1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-30 07:03:48 +00:00

PM-3350 Migrated some Device to DeviceInfo and added temporary workaround with some comments to be able to see the Generated Password on iOS

This commit is contained in:
Dinis Vieira
2023-10-20 00:04:19 +01:00
parent 174acbc558
commit 8be8abb8fe
2 changed files with 14 additions and 20 deletions

View File

@@ -1,21 +1,20 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls
namespace Bit.App.Controls
{
public class MonoLabel : Label
{
public MonoLabel()
{
// TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes
switch (Device.RuntimePlatform)
if (DeviceInfo.Platform == DevicePlatform.iOS)
{
case Device.iOS:
FontFamily = "Menlo-Regular";
break;
case Device.Android:
FontFamily = "RobotoMono_Regular.ttf";
break;
FontFamily = "Menlo-Regular";
//[MAUI-Migration] Temporary Workaround for the Text to appear in iOS.
// A proper solution needs to be found to be able to have html text with different colors or alternatively use Label FormattedString Spans
TextColor = Colors.Black;
}
else if (DeviceInfo.Platform == DevicePlatform.Android)
{
FontFamily = "RobotoMono_Regular.ttf";
}
}
}