shared element transitions
TRANSCRIPT
Shared Element TransitionsGDG Leeds - February 2017Mike Scamell
What are Shared Element Transitions?
Google Play Music
Plaid
eBay
How do they work?
Why should I use them?
Material motionFocal point
Hint
Distraction
Refined
Easy to implement
Can be used with image loading libs
They look cool 😎
SHOW ME THE DAMN CODE! 😠
Enabling
<!-- Base application theme. --><style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> //add this line to your file <item name="android:windowContentTransitions">true</item></style>
Transition Names
<ImageView android:id="@+id/simple_activity_a_imageView" android:layout_width="128dp" android:layout_height="96dp" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="80dp" android:scaleType="centerCrop" android:src="@drawable/lion" android:transitionName="simple_activity_transition" />
Setting the Shared Element Transition
Intent intent = new Intent(SimpleActivityA.this, SimpleActivityB.class);ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation( SimpleActivityA.this, imageView, "simple_activity_transition");startActivity(intent, options.toBundle());
Et voila!
Gotchas?
White flashingNav bar, Status bar
Picasso
May need to exclude other views
Large images
Standing on the shoulders of giants
Articleshttps://medium.com/@bherbst/fragment-transitions-with-shared-elements-7c7d71d31cbb#.lry08ybje
http://www.androidauthority.com/using-shared-element-transitions-activities-fragments-631996/
https://guides.codepath.com/android/Shared-Element-Activity-Transition
https://developer.android.com/training/material/animations.html
Fixeshttps://plus.google.com/+AlexLockwood/posts/RPtwZ5nNebb
Sampleshttps://github.com/alexjlockwood/adp-activity-transitions
Thank youhttps://github.com/mikescamell/shared-element-transitionshttp://mikescamell.com/shared-element-transitions-part-1
@mikescamell