maui
maui copied to clipboard
[Android] Map FlowDirection of shell to PlatformView on Android
Description of Change
I mapped FlowDirection of shell to PlatformView on Android. this PR fixes #15221 on Android
https://github.com/dotnet/maui/assets/85581484/3fdefbf1-efe0-490b-a45d-314af39f3654
Issues Fixed
Fixes #15221
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
hi is there any Workaround to this Issue !?
hi is there any Workaround to this Issue !?
I fixed it on Android, but it still hasn't been merged.
Should I wait for merger approval, any tips to fix the issue separately on my project side?
Should I wait for merger approval, any tips to fix the issue separately on my project side?
You can do it as shown below in the AppShell.xaml.cs file:
public partial class AppShell : Shell
{
public AppShell()
{
InitializeComponent();
}
protected override void OnHandlerChanged()
{
base.OnHandlerChanged();
#if ANDROID
var platformView = Handler.PlatformView;
var shellFlyoutRenderer = (ShellFlyoutRenderer)platformView;
shellFlyoutRenderer.LayoutDirection = Android.Views.LayoutDirection.Rtl;
#elif IOS || MACCATALYST
FlowDirection = FlowDirection.RightToLeft;
#endif
}
}
I couldn't find any way to correct it on Windows
Should I wait for merger approval, any tips to fix the issue separately on my project side?
You can do it as shown below in the AppShell.xaml.cs file:
public partial class AppShell : Shell { public AppShell() { InitializeComponent(); } protected override void OnHandlerChanged() { base.OnHandlerChanged(); #if ANDROID var platformView = Handler.PlatformView; var shellFlyoutRenderer = (ShellFlyoutRenderer)platformView; shellFlyoutRenderer.LayoutDirection = Android.Views.LayoutDirection.Rtl; #elif IOS || MACCATALYST FlowDirection = FlowDirection.RightToLeft; #endif } }I couldn't find any way to correct it on Windows
The operation went as planned, and I am grateful for your support, truly it saved my day
/rebase
Azure Pipelines successfully started running 3 pipeline(s).
Sorry it took a while @mohsenbgi! I think this looks good, thank you so much for your very first .NET MAUI contribution!
I think it might be good to add maybe some (snapshot) tests for this, but lets do that as a follow up.
Congrats @mohsenbgi! Go update your social media profiles with .NET MAUI contributor extraordinaire!
Thank you so much for your efforts on this! and your patience...