[PM-3349] [PM-3350] MAUI Migration Initial - #2806
Conversation
|
New Issues
Fixed Issues
|
…yncCommand canExecute null exception
Added CustomTabbedPageHandler for Android to handle the tab "reselection" for PopToRoot. Commented support for Windows in App.csproj Disabled Interpreter on Android to avoid very slow app in Debug (during Login for example) Added some null checks that were causing crashes (on GeneratorPageVM and PickerVM) Minor TabsPage cleanup
…TabbedPageHandler
… opening Secure Notes.
Changed MainApplication SpecialFolder.Personal to SpecialFolder.LocalApplicationData
…/mobile into feature/maui-migration
…d factor auth flows Ensured CustomTabbedPageHandler had it's DisconnectHandler called Some minor code upgrades of older obsolete Xamarin Forms code.
…Android bugs where they fill much larger space.
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)
…the buggy shadows on the Android Fab Button.
…h fonts as MAUI is taking care of Accessibility and no custom code should be needed Migrated SelectableLabelRenderer to Handler Cleaned LabelHandlerMappings and added logic to migrate the CustomLabelRenderer
…ound with some comments to be able to see the Generated Password on iOS
SearchBarHandlerMapping: IME options working as intended SliderHandlerMappings: The MAUI "replacement" for Color.Default seems to be White so the old use case doesn't seem to be needed anymore.
# Conflicts: # src/App/Platforms/Android/AndroidManifest.xml
…n the Directory.Build.props
…hat is causing the background crash on iOS; so we can test this in TestFlight
…/mobile into feature/maui-migration
andrebispo5
left a comment
There was a problem hiding this comment.
Awesome work!
Just a couple of things that came to attention on a first pass.
| @@ -8,13 +9,14 @@ public class IconButton : Button | |||
| public IconButton() | |||
| { | |||
| Padding = 0; | |||
| // 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 | |||
There was a problem hiding this comment.
❓ was this address? can it be removed?
There was a problem hiding this comment.
As you can see Device.RuntimePlatform is still being used, it should be changed for DeviceInfo.Platform instead or use precompiler directives. However, this is really low priority.
| @@ -9,13 +10,14 @@ public class IconLabel : Label | |||
|
|
|||
| public IconLabel() | |||
| { | |||
| // 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 | |||
There was a problem hiding this comment.
❓ was this address? can it be removed?
There was a problem hiding this comment.
As you can see Device.RuntimePlatform is still being used, it should be changed for DeviceInfo.Platform instead or use precompiler directives. However, this is really low priority.
| @@ -7,13 +8,14 @@ public class MiButton : Button | |||
| public MiButton() | |||
| { | |||
| Padding = 0; | |||
| // 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 | |||
There was a problem hiding this comment.
❓ was this address? can it be removed?
There was a problem hiding this comment.
As you can see Device.RuntimePlatform is still being used, it should be changed for DeviceInfo.Platform instead or use precompiler directives. However, this is really low priority.
|
|
||
| namespace Bit.App.Controls | ||
| { | ||
| public class MiLabel : Label | ||
| { | ||
| public MiLabel() | ||
| { | ||
| // 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 |
There was a problem hiding this comment.
❓ was this address? can it be removed?
There was a problem hiding this comment.
As you can see Device.RuntimePlatform is still being used, it should be changed for DeviceInfo.Platform instead or use precompiler directives. However, this is really low priority.
| StyleClass="box-value" | ||
| AutomationProperties.IsInAccessibleTree="True" | ||
| AutomationProperties.Name="{u:I18n Name}" | ||
| SemanticProperties.Description="{u:I18n Name}" |
There was a problem hiding this comment.
🔧 According to Microsoft docs Entry's should use Placeholder instead of Description because of Android's Talkback.
SemanticProperties.Placeholder="{u:I18n Name}"
MicrosoftDocs
Github Issue
There was a problem hiding this comment.
If we proceed with this change there a couple more places that this is happening and needs to me fixed.
There was a problem hiding this comment.
Nice finding 🎉 , can you create a Jira ticket with this? At the moment, we just replaced the whole solution Name with Description to compile, but yes we should definitely tackle this at some point.
aj-rosado
left a comment
There was a problem hiding this comment.
Great work!
Just added some comments regarding cleanup work and a couple workarounds that seem to be fixed.
| { | ||
| base.OnResume(); | ||
| Xamarin.Essentials.Platform.OnResume(); | ||
| //Xamarin.Essentials.Platform.OnResume(); |
There was a problem hiding this comment.
If this is not necessary anymore we could remove this
| Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults); | ||
| PermissionsHandler.OnRequestPermissionsResult(requestCode, permissions, grantResults); | ||
| Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults); | ||
| //Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults); |
There was a problem hiding this comment.
If not necessary, remove the commented code
| ZXing.Net.Mobile.Forms.Android.Platform.Init(); | ||
| }); | ||
| CrossFingerprint.SetCurrentActivityResolver(() => CrossCurrentActivity.Current.Activity); | ||
| //Task.Run(() => |
|
|
||
| //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 |
There was a problem hiding this comment.
This issues have been closed
There was a problem hiding this comment.
I think @dinisvieira tested it and the issue was still happening. Was it? Maybe we should check again.
…rs and also made easier to maintain loading the argon2id library on the iOS projects by setting a general Directory.Build.props that is shared.
…rties instead of replacing the existing Options object which would cause the AccountSwitcher button bug (#2973)
…on (#2969) * PM-5896 Fix background crash on iOS due to lock files when app gets suspended. Changed loading and error placeholders of the CachedImage to not be used and use default icon of IconLabel instead changing visibility. * PM-5896 Changed methods to be protected so that they don't get removed by the linker. * PM-5896 Added stub class and references to it so to have stronger references to Icon_Success and Icon_Error so the linker doesn't remove them.
…s not needed anymore.
LRNcardozoWDF
left a comment
There was a problem hiding this comment.
Amazing work! Just found a nitpick.
| var magImage = (Android.Widget.ImageView)handler.PlatformView.FindViewById(magId); | ||
| magImage.LayoutParameters = new Android.Widget.LinearLayout.LayoutParams(0, 0); | ||
| } | ||
| catch { } |
There was a problem hiding this comment.
Is this empty catch intentional?
There was a problem hiding this comment.
Yes, it's the same we have on the current Xamarin app https://github.com/bitwarden/mobile/blob/main/src/Android/Renderers/CustomSearchBarRenderer.cs#L27
… be used on iOS.Core (#2983)
… light theme on iOS (#2982) * PM-5907 workaround for incorrect textcolor when programmatically changing text on Entry * Update src/Core/Pages/Vault/CipherAddEditPage.xaml.cs Co-authored-by: Federico Maccaroni <fedemkr@gmail.com> --------- Co-authored-by: Federico Maccaroni <fedemkr@gmail.com>
…when using light theme on iOS (#2981) * PM-5906 workaround for incorrect textcolor when programmatically changing text on Entry * Update src/Core/Pages/Send/SendAddEditPage.xaml.cs Co-authored-by: Federico Maccaroni <fedemkr@gmail.com> --------- Co-authored-by: Federico Maccaroni <fedemkr@gmail.com>
…g when it's not possible


Type of change
Objective
Migrate app to NET MAUI
Before you submit
dotnet format --verify-no-changes) (required)