Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Feature request] Shared element transitions #3334

Closed
sdebruyn opened this issue Jul 18, 2018 · 7 comments
Closed

[Feature request] Shared element transitions #3334

sdebruyn opened this issue Jul 18, 2018 · 7 comments

Comments

@sdebruyn
Copy link

Description

A lot of modern apps feature animated transitions between two screens with a shared element. This is a feature that is currently missing in Xamarin.Forms. Example.

Steps to Reproduce

  1. Build a page with an image
  2. Put the same image on another page and give it the same ID
  3. Add the shared element transition to the page and link it to the image

Expected Behavior

A shared element transition

Actual Behavior

Nothing

Basic Information

N/A

Screenshots

https://2.bp.blogspot.com/-0pcB1xepQH8/WFknZ0Bst3I/AAAAAAAAA0k/FHU1KmMjCHA2QXHkDwtzy0UZjNGIRvrCgCLcB/s640/ezgif.com-video-to-gif.gif

@PureWeen
Copy link
Contributor

There's a segue api coming
#2816

The Animations part of the spec has yet to be defined but I foresee this enhancement being covered there

@GalaxiaGuy
Copy link
Contributor

This is something I am very interested in. The following is mainly just a dump of information and thoughts I've had about this recently

Android already has this as a concept, but taking advantage of it on top of Forms is difficult since many members in NavigationRenderer cannot be overriden.

I did experiment with implementing this in iOS "manually" using UIViewControllerTransitioningDelegate and it was fairly straightforward.

I know nothing about UWP or other platforms.

The native Android version has support for a lot of customization. I think a version that just handles the scale and translation from old position to new position would be adequate (although extension points would be nice).

One issue I faced when I experimented is what the proper way is to go from a Forms Element to a native view. Is Platform.GetRenderer the right way to go? Or should there be a property on Element that sets something like iOS's tag on UIView so the native code can find relevant views directly?

@GiampaoloGabba
Copy link
Contributor

This would be a great addition to forms. We need some of those "new" concepts used in many modern apps. I'm about to start to experiment this on Android, @GalaxiaGuy would you like to share your experiments made in IOS?

@GalaxiaGuy
Copy link
Contributor

GalaxiaGuy commented Aug 8, 2018

@EvolutionLab This is what came up with:

https://github.com/GalaxiaGuy/SharedElementTest

It's based around IUINavigationControllerDelegate and UIViewControllerAnimatedTransitioning. It's limited to transitioning a single element, and the UIViews are looked-up based on an effect setting the Tag.

Mostly based on this: https://www.raywenderlich.com/322-custom-uiviewcontroller-transitions-getting-started

@GiampaoloGabba
Copy link
Contributor

@GalaxiaGuy thank you.

@GiampaoloGabba
Copy link
Contributor

GiampaoloGabba commented Aug 20, 2018

In my spare time i was able to make it work in IOS & Android with some limitations.
More informations and code here: https://github.com/Evolutionlab/EvoTransitions
This is a proof of concept, maybe some developer more experienced than me can take ispiration from my work and develop something more robust and flexibile to make a pull request :)

@samhouts
Copy link
Member

Duplicate of #6033

@samhouts samhouts marked this as a duplicate of #6033 Feb 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants