Skip to content
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

SharedTransition Tabbed page within MasterDetail page #30

Closed
alexgg94 opened this issue Apr 17, 2020 · 4 comments
Closed

SharedTransition Tabbed page within MasterDetail page #30

alexgg94 opened this issue Apr 17, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@alexgg94
Copy link

Hi, I'm using the sample app (TransitionApp) to try out different scenarios.
Now I'm trying to work with a Tabbed page within a MasterDetail page.
I have modified the MainMasterDetailPage file changing the Detail page:

`

<MasterDetailPage.Master>
    <ContentPage Title="Menu">
        <StackLayout Padding="20" VerticalOptions="Center">
            
            <Button Text="Images" Command="{prism:NavigateTo 'SharedTransitionNavigationPage/ImageFromPage'}" />
            <Button Text="Layouts" Command="{prism:NavigateTo 'SharedTransitionNavigationPage/LayoutFromPage'}" />
            <Button Text="Listview" Command="{prism:NavigateTo 'SharedTransitionNavigationPage/ListViewFromPage'}" />
            <Button Text="Collectionview" Command="{prism:NavigateTo 'SharedTransitionNavigationPage/CollectionviewFromPage'}" />
            <Button Text="Back to main Home" Command="{prism:NavigateTo '/HomePage'}" />
        </StackLayout>
    </ContentPage>
</MasterDetailPage.Master>


<!--<MasterDetailPage.Detail>
    <main:MainTabbedPage/>
</MasterDetailPage.Detail>-->

<MasterDetailPage.Detail>
    <sharedTransitions:SharedTransitionNavigationPage>
        <x:Arguments>
            <main:MainTabbedPage/>
        </x:Arguments>
    </sharedTransitions:SharedTransitionNavigationPage>
</MasterDetailPage.Detail>

`

(MainTabbedPage has not been modified)
But this is not working even if I put the MainTabbedPage within a SharedTransitionNavigationPage. Am I doing something wrong?

Thanks

@GiampaoloGabba
Copy link
Owner

For this to work, you have to put the tabbedpage's tabs inside a SharedTransitionNavigationPage, just like in the Tab example in the Sample App.

A TabbedPage is only a container of pages and the navigation occour inside tabs.

In conclusion, you should modify your <main:MainTabbedPage/> to encapsulate the tabs that need transitions inside a SharedTransitionNavigationPage, something like this

@alexgg94
Copy link
Author

alexgg94 commented Apr 17, 2020

Yes, that's what I'm doing.

<main:MainTabbedPage/> refrences https://github.com/GiampaoloGabba/Xamarin.Plugin.SharedTransitions/blob/master/src/Sample/TransitionApp/TransitionApp/Views/Main/MainTabbedPage.xaml

It's exactly the same project but I only modified the MasterDetailPage as I stated above

@GiampaoloGabba
Copy link
Owner

awww sorry, didn't recognize that the example you posted is from my SampleApp :)

Well, i never tried to put a TabbedPage inside a MasterDetails, in theory this should works:

<MasterDetailPage.Detail>
    <main:MainTabbedPage/>
</MasterDetailPage.Detail>

i will try to diagnose whats going on here

@GiampaoloGabba
Copy link
Owner

Ok i found the culprit: in iOS TabbedPage inside MasterDetail is working.
In Android the issue is the FragmentManager and relative ChildFragmentManager.
Using TabbedPage inside MasterDetail create another level of ChildFragmentManager and the plugin is unable to read it for now.

I need a new way to find the right FragmentManager for the current page

@GiampaoloGabba GiampaoloGabba added the bug Something isn't working label May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants