Skip to content

[Android] Map FlowDirection of shell to PlatformView on Android #23473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

mohsenbgi
Copy link
Contributor

@mohsenbgi mohsenbgi commented Jul 7, 2024

Description of Change

I mapped FlowDirection of shell to PlatformView on Android.
this PR fixes #15221 on Android

Recording.2024-07-07.141928.mp4

Issues Fixed

Fixes #15221
Fixes #17057

@mohsenbgi mohsenbgi requested a review from a team as a code owner July 7, 2024 10:26
@mohsenbgi mohsenbgi requested review from mattleibow and PureWeen July 7, 2024 10:26
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jul 7, 2024
@rmarinho
Copy link
Member

rmarinho commented Jul 9, 2024

/azp run

This comment was marked as off-topic.

@Kremed
Copy link

Kremed commented Aug 22, 2024

hi is there any Workaround to this Issue !?

@mohsenbgi
Copy link
Contributor Author

hi is there any Workaround to this Issue !?

I fixed it on Android, but it still hasn't been merged.

@Kremed
Copy link

Kremed commented Aug 26, 2024

Should I wait for merger approval, any tips to fix the issue separately on my project side?

@mohsenbgi
Copy link
Contributor Author

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

@Kremed
Copy link

Kremed commented Aug 27, 2024

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

@jfversluis

This comment was marked as off-topic.

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jfversluis jfversluis added this to the .NET 9 SR5 milestone Feb 19, 2025
@jfversluis
Copy link
Member

jfversluis commented Feb 20, 2025

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.

@PureWeen PureWeen merged commit 1a87fea into dotnet:main Feb 20, 2025
123 checks passed
@jfversluis
Copy link
Member

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...

@github-actions github-actions bot locked and limited conversation to collaborators Mar 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-shell Shell Navigation, Routes, Tabs, Flyout community ✨ Community Contribution partner/syncfusion/review
Projects
Status: Done
6 participants