GiampaoloGabba / Xamarin.Plugin.SharedTransitions

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

[BUG] Back to page animation does not work in XF 5.0.0.2196. #71

Open ghost opened 2 years ago

ghost commented 2 years ago

Hi everyone, today I upgraded XF to version 5.0.0.2196 and unfortunately the site animation does not work as before. Next page animation works well but back animation doesn't. I used to use XF version 5.0.0.2012 and everything worked fine. I enclose a few screenshots. Thanks a lot.

Bug Information

Version Number of Plugin: 2.4.0 Device Tested On: Realme GT Android 11, OnePlus 9 Pro Android 11. Tested on other devices with the same effect Simulator Tested On: Pixel3_XL_API_30 Version of VS: 16.11.5 Version of Xamarin: 5.0.0.2196 Versions of other things you are using: Xamarin.Essentials 1.7.0

Steps to reproduce the Behavior

Just create a new Xamarin Forms project and upgrade XF to the latest build 5.0.0.2196. That is all. You don't have to add anything else. He tried it in XF.Shell and in a blank window. Same mistake.

Expected Behavior

The animation back to the page should work as in the previous version of XF 5.0.0.2012. see video XF_5.0.0.2012.

Actual Behavior

The back to page animation does not work. see video XF_5.0.0.2196.

Code snippet

in XAML NavigationPage.HasNavigationBar="False" NavigationPage.HasBackButton="False" sharedTransitions:SharedTransitionNavigationPage.TransitionDuration="300" sharedTransitions:SharedTransitionNavigationPage.BackgroundAnimation="SlideFromRight"

in App.cs MainPage = new SharedTransitionNavigationPage(new Page1());

Navigate to the page App.Current.MainPage.Navigation.PushAsync(new Page2());

Navigate back to the page App.Current.MainPage.Navigation.PopAsync();

Screenshots

https://user-images.githubusercontent.com/5471789/141354257-932f97a3-a8e5-468d-baea-2e34f6e59cb7.mp4

https://user-images.githubusercontent.com/5471789/141354325-9c92df2c-f23a-4672-a214-4a2fdf25a619.mp4

brettnguyen commented 2 years ago

Good luck the author of this project hasn’t responded in like over a year. I have similar problem and I’ve received little to no help. I wish I could help you but unfortunately with out the help of the creator it becomes difficult as to I am still trying to fix my problem.

ghost commented 2 years ago

Yes, it seems that this project will be unusable in the future. Therefore, I applied for the inclusion of this project in the XamarinCommunityToolkit. It would be great to have this option with a box with additional features in one XCT project.

RonnyRos commented 2 years ago

I have not have time to check this fully out, but i noticed running the sample AndroidX app and debug the following method:

public static void RemoveTransition(View view, Page currentPage)...

currentPage.Parent = null <-- Which again will not trigger removing the transitionmap. Not sure if thats the case why we get a whitescreen on navigating back. currentPage.Parent should probably be the SharedTransitionNavigationPage reference?

AdamEssenmacher commented 2 years ago

Updates to AndroidX.Fragment have almost completely broken this plugin on Android.

tomh4 commented 2 years ago

Unfortunately yes, this was such a good lib... there are also no alternatives :(

GiampaoloGabba commented 2 years ago

Unfortunately the latest versions of xf modified a lot of things in navigations. for example the NavigationaPage (and i suspect Shell too)) in Android is completely broken for this plugin. The problem is that the fragments generation in the destination page now happens too late to attach a shared transition inside the available overrides provided by XF, there is no fix for that oter than rewrite all the platform navigation logic (not going to happen).

Also something is changed in the iOS navigation that broke the back button.

I spent a few hours trying to fix those issue but the Android one hit me hard, is unfixable :(

So i cannot be able to support this for XForms 5 anymore (the first version of XF5 should still work) and i'm going full in with MAUI with a full rewrite.

MAUI handlers are way more flexibile and expandable than XF renderers.

I think that this plugin was too "hacky" for XF and too suscetible at every minor changes made by the XF team in the navigation logic, incapsulated in renderers with very few entry point available to extend.

I have some nice idea for MAUI, i want to be able to make shared transition on grouped view more easily and semplify by A LOT all the source code, expecially the iOS one (where there are not OS support for shared transitions and i had to do some crazy things to emulate them).

joaquin171993 commented 1 year ago

: 'Unable to activate instance of type Xamarin.Forms.Platform.Android.FastRenderers.ImageRenderer from native handle 0x7fcce09dc4 (key_handle 0xa0b4ded).'

I have a problem with the package. I'm here with version 5.0.0.2515 of Xamarin Forms