styles.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name="android:windowContentTransitions" tools:targetApi="lollipop">true</item> </style>
Caller Activity
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) { Bundle bundle = ActivityOptions.makeSceneTransitionAnimation(this).toBundle(); startActivity(intent, bundle); } else { startActivity(intent); }
Calling Activity
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Slide transition=new Slide(); transition.setDuration(300); transition.setSlideEdge(Gravity.BOTTOM); transition.setMode(Visibility.MODE_IN); getWindow().setEnterTransition(transition); }
References
https://stackoverflow.com/questions/35064342/activity-transitions-not-working
https://developer.android.com/training/material/animations.html
https://github.com/lgvalle/Material-Animations