GiampaoloGabba / Xamarin.Plugin.SharedTransitions

Shared Element Transitions between pages in Xamarin.Forms (IOS/Android)
MIT License
414 stars 57 forks source link

Doesn't animate when destination page elements have set Transition.Group #38

Closed Inrego closed 4 years ago

Inrego commented 4 years ago

Bug Information

Version Number of Plugin: 2.2.0 Device Tested On: Android API 29 Simulator Tested On: none Version of VS: Community 2019 16.6.3 Version of Xamarin: 16.6.000.1062 Versions of other things you are using: Xamarin.Forms: 4.7.0.1080 Prism.Dryloc.Forms: 7.2.0.1422

Steps to reproduce the Behavior

On destination page, set both Transition.Group and Transition.Name

Expected Behavior

Animation will happen.

Actual Behavior

No animation when navigating to destination page.

Code snippet

Source page template of collectionview:

  <BoxView
    sharedTransitions:Transition.Group="{Binding Id}"
    sharedTransitions:Transition.Name="ColorBox"
    BackgroundColor="{Binding Color}" />

Destination page:

  <BoxView
    sharedTransitions:Transition.Group="{Binding Data.Id}"
    sharedTransitions:Transition.Name="ColorBox"
    BackgroundColor="{Binding Data.Color}" />

Elaboration

I want to animate an element between multiple pages. So the flow will be something like> Page 1: CollectionView which shows all elements Page 2: Details page. Animate a view from collectionview to a view on this page. Page 3: Advanced details page. Animate the same view from page 2 to this page.

If you want, I can put up a sample project.

Inrego commented 4 years ago

I managed a workaround by setting/removing group when navigating to/from page 2.

Inrego commented 4 years ago

Almost working. When going back from page 2 to page 1, the elements which I've changed the group to a value and back to null again, are not animated.