I was implementing material design for my app. I saw that it is possible to make transitions between activities just here: http://android-developers.blogspot.com.es/2014/10/impl
Activity Transitions are exclusive to Android 5.0. ActivityOptionsCompat. makeSceneTransitionAnimation
doesn't do anything if you're running 19 or below.
ActivityOptionsCompat.makeSceneTransitionAnimation
works only on api level >= 21.
From docs:
Some material design features like the material theme and custom activity transitions are only available on Android 5.0 (API level 21) and above. However, you can design your apps to make use of these features when running on devices that support material design and still be compatible with devices running previous releases of Android.
Here is it's definition:
public static ActivityOptionsCompat makeSceneTransitionAnimation(Activity activity,
View sharedElement, String sharedElementName) {
if (Build.VERSION.SDK_INT >= 21) {
return new ActivityOptionsCompat.ActivityOptionsImpl21(
ActivityOptionsCompat21.makeSceneTransitionAnimation(activity,
sharedElement, sharedElementName));
}
return new ActivityOptionsCompat();
}
So why does that method exist in support package?
It is done so in order to maintain backward compatibility with older versions (api level <=20). From maintaining compatibility docs:
// Check if we're running on Android 5.0 or higher
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// Call some material design APIs here
} else {
// Implement this feature without material design
}