1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-03 09:03:35 +00:00

PM-3349 PM-3350

Added (migrated) CustomNavigationHandler (which should partially fix the AvatarIcon in the NavBar in iOS)
Added (migrated) CustomContentPageHandler (which should mostly place the AvatarIcon in the navBar in the correct place for iOS)
Added Task.Delay (workaround) to allow the Avatar to load in iOS on the LoginPage
Added workaround for iOS bug with the toolbar size (more info in comment in AvatarImageSource.cs)
Went through the AccountViewCell MAUI-Migration comments. (and deleted/added more comments as needed)
Migrated some Device calls to DeviceInfo and MainThread
Added (migrated) CustomTabbedHandler (for managing the iOS TabBar)
This commit is contained in:
Dinis Vieira
2023-10-15 22:06:26 +01:00
parent 2e4da1b87d
commit ce9503fa0c
7 changed files with 274 additions and 24 deletions

View File

@@ -8,7 +8,7 @@
xmlns:core="clr-namespace:Bit.Core"
x:Name="_accountView"
x:DataType="controls:AccountViewCellViewModel">
<!--TODO: [MAUI-Migration] add long press
<!--TODO: [MAUI-Migration] add long press ( https://github.com/CommunityToolkit/Maui/issues/86 )
xct:TouchEffect.LongPressCommand="{Binding LongPressAccountCommand, Source={x:Reference _accountView}}"
xct:TouchEffect.LongPressCommandParameter="{Binding .}"-->
<Grid RowSpacing="0"
@@ -144,17 +144,6 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!--TODO: [MAUI-Migration] check that is the same-->
<!--<Image
Grid.Column="0"
VerticalOptions="Center"
HorizontalOptions="Center"
Margin="14,0"
WidthRequest="{OnPlatform 24, iOS=24, Android=26}"
HeightRequest="{OnPlatform 24, iOS=24, Android=26}"
Source="plus.png"
xct:IconTintColorEffect.TintColor="{DynamicResource TextColor}"
AutomationProperties.IsInAccessibleTree="False" />-->
<controls:IconLabel
Grid.Column="0"
VerticalOptions="Center"

View File

@@ -79,6 +79,14 @@ namespace Bit.App.Controls
var textColor = CoreHelpers.TextColorFromBgColor(bgColor);
var size = 50;
//Workaround: [MAUI-Migration] There is currently a bug in MAUI where the actual size of the image is used instead of the size it should occupy in the Toolbar.
//This causes some issues with the position of the icon. As a workaround we make the icon smaller until this is fixed.
//Github issues: https://github.com/dotnet/maui/issues/12359 and https://github.com/dotnet/maui/pull/17120
if (DeviceInfo.Platform == DevicePlatform.iOS)
{
size = 20;
}
using (var bitmap = new SKBitmap(size * 2,
size * 2,
SKImageInfo.PlatformColorType,