GiampaoloGabba / Xamarin.Plugin.SharedTransitions

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

Support for .NET MAUI #72

Open sattasundar opened 2 years ago

sattasundar commented 2 years ago

I am looking this plugin for support .NET MAUI.

IeuanWalker commented 1 year ago

Anyone working on this?

eXeShnik commented 6 months ago

@IeuanWalker I am working on it, ios part migrated easily, but android core changed on Maui, need time to fix it

eXeShnik commented 6 months ago

Guys, unfortunately, currently it is impossible to do it on android, in right way Microsoft developers implemented almost all android stuff internal or private, btw you could check my fork, MB it will be possible in net 9, cause I checked MAUI src, they changed nothing between NET 7 and 8 But I did something, use reflection, use maui src code, and transition is working partially, forward only Ios is working because they still use old renderer impl in it

eXeShnik commented 6 months ago

Ohhh I think I know how I can fix backward transition :) Btw we still need possibility from Microsoft devs to use it without reflection

PureWeen commented 6 months ago

@eXeShnik do you have a MAUI branch published you're working on yet?

I can poke Android a little bit to see what I can do.

eXeShnik commented 6 months ago

@PureWeen Hi, I did it here https://github.com/eXeShnik/Xamarin.Plugin.SharedTransitions/tree/feature/maui Can I publish something without PR into this repo? P.s. My first time to contribute something

PureWeen commented 6 months ago

Aw, ok, you're not the original author.

I'll take a look at your branch but @GiampaoloGabba would need to merge the changes once approved.

AlexeyStarkov commented 6 months ago

@PureWeen Hi, I did it here https://github.com/eXeShnik/Xamarin.Plugin.SharedTransitions/tree/feature/maui Can I publish something without PR into this repo? P.s. My first time to contribute something

As I can see, you've added support only for Android. Am I right?

eXeShnik commented 6 months ago

@PureWeen Hi, I did it here https://github.com/eXeShnik/Xamarin.Plugin.SharedTransitions/tree/feature/maui Can I publish something without PR into this repo? P.s. My first time to contribute something

As I can see, you've added support only for Android. Am I right?

Nope, I migrated ios version too

AlexeyStarkov commented 6 months ago

@PureWeen Hi, I did it here https://github.com/eXeShnik/Xamarin.Plugin.SharedTransitions/tree/feature/maui Can I publish something without PR into this repo? P.s. My first time to contribute something

As I can see, you've added support only for Android. Am I right?

Nope, I migrated ios version too

Great news. The only concern I have is that there is no SharedTransitionNavigationRendererNew class for iOS

eXeShnik commented 6 months ago

@PureWeen Hi, I did it here https://github.com/eXeShnik/Xamarin.Plugin.SharedTransitions/tree/feature/maui Can I publish something without PR into this repo? P.s. My first time to contribute something

As I can see, you've added support only for Android. Am I right?

Nope, I migrated ios version too

Great news. The only concern I have is that there is no SharedTransitionNavigationRendererNew class for iOS

Ohhh I am so sorry, I just worked on android implementation and forget to change it back

AlexeyStarkov commented 6 months ago

@PureWeen Hi, I did it here https://github.com/eXeShnik/Xamarin.Plugin.SharedTransitions/tree/feature/maui Can I publish something without PR into this repo? P.s. My first time to contribute something

As I can see, you've added support only for Android. Am I right?

Nope, I migrated ios version too

Great news. The only concern I have is that there is no SharedTransitionNavigationRendererNew class for iOS

Ohhh I am so sorry, I just worked on android implementation and forget to change it back

ok, I'll wait for the update from you. I'm looking forward to trying your version.

eXeShnik commented 6 months ago

@AlexeyStarkov I puhsed

AlexeyStarkov commented 6 months ago

@eXeShnik Thank you. I'm trying your branch on iOS right now and it throws an exception at line 101 of the Platform/iOS/ViewExtensions.cs when the fromView argument is MauiLabel. The following code causes a crash: return (UIView)NSKeyedUnarchiver.UnarchiveObject(NSKeyedArchiver.GetArchivedData(fromView));

Exception description: ObjCRuntime.RuntimeException: Failed to marshal the Objective-C object 0x11d01d300 (type: Microsoft_Maui_Platform_MauiLabel). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'Microsoft.Maui.Platform.MauiLabel' does not have a constructor that takes one NativeHandle argument).

I'm not surprised because I'm stuck with a crash in the same place while trying to migrate the plugin on my own. After I had replaced the obsolete UnarchiveObject and GetArchivedData methods with the modern ones I got the "This decoder will only decode classes that adopt NSSecureCoding" exception which means that MauiLabel/UILabel doesn't implement the INSSecureCoding interface. And I have no idea so far how it worked recently with Xamarin.

eXeShnik commented 6 months ago

AlexeyStarkov

Thx for feedback I tried only ImageView, did not check other controls

GV1072 commented 6 months ago

I am also looking this plugin for support .NET MAUI. Please share the info when migration completed.

Thanks in Advance

PureWeen commented 3 months ago

@eXeShnik apologies for the slow response

Did you look at publishing a Maui version out as your own nuget?

If you want to chat more actively pop over to the .NET MAUI discord

https://aka.ms/dotnet-discord

Th3L0x commented 1 week ago

Hi, is there any update on this? Your fork now works on Android/iOS @eXeShnik?