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

Hero image transition animation #66

Open
andhie opened this issue Jun 25, 2018 · 7 comments · May be fixed by softagram/android-sunflower#1 or #196
Open

Hero image transition animation #66

andhie opened this issue Jun 25, 2018 · 7 comments · May be fixed by softagram/android-sunflower#1 or #196
Labels
enhancement New feature or request

Comments

@andhie
Copy link
Contributor

andhie commented Jun 25, 2018

Doing transition animation to detail activity via the hero image

Work to do:
Use ActivityOptionsCompat#makeSceneTransitionAnimation(). for the animation by passing in activity and the imageview.
Each list item in Plant adapter should use ViewCompat#setTransitionName() and prefix/suffixed with item position. Both list and detail imageview need to have same transition name. this allows anim to transition backwards when user press back on Detail activity
We need to delay anim in detail via supportPostponeEnterTransition() until Glide loads the image and then use supportStartPostponedEnterTransition()

https://developer.android.com/reference/android/support/v4/app/ActivityOptionsCompat.html#makescenetransitionanimation_4
https://developer.android.com/reference/android/support/v4/view/ViewCompat.html#setTransitionName(android.view.View,%20java.lang.String)

@tiembo
Copy link
Contributor

tiembo commented Jun 25, 2018

Related to #9

@tiembo tiembo added the enhancement New feature or request label Jun 25, 2018
@tiembo
Copy link
Contributor

tiembo commented Jun 28, 2018

@andhie now that #9 is resolved and the app is a single activity, the work outlined might need to change a bit.

@andhie
Copy link
Contributor Author

andhie commented Jul 2, 2018

For normal fragments, we can use setSharedElement on the FragmentTransaction. but in the case of Navigation, i'm not sure how you achieve this. is it supported at this moment?

@tiembo
Copy link
Contributor

tiembo commented Jul 2, 2018

@andhie shared element transitions with the Navigation component is in the works: https://issuetracker.google.com/issues/79665225

@neiljaywarner
Copy link

nudge. this would be great

@tiembo
Copy link
Contributor

tiembo commented Sep 20, 2018

@andhie shared element transitions are now available in Navigation 1.0.0-alpha06, which has been merged via #193

@tiembo tiembo removed the blocked Issue blocked by other factors label Sep 20, 2018
@andhie
Copy link
Contributor Author

andhie commented Sep 21, 2018

@tiembo i have committed some code in my own repo.
in the FragmentNavigator see its adding the Navigator.Extras into the ft.addSharedElement(...) yet its not animating. cant figure out why.
andhie@33d9aa9

@andhie andhie linked a pull request Sep 22, 2018 that will close this issue
@villelaitila villelaitila linked a pull request Jan 24, 2019 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
4 participants
@tiembo @neiljaywarner @andhie and others