Android transition is same for explode and slide.Actually I don't think its animating. Also duration is not 6 seconds. How can I fix it?
Code taken from here.
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
Transition ts = new Slide(); //Slide(); //Explode();
ts.setDuration(6000);
getWindow().setEnterTransition( ts );
getWindow().setExitTransition( ts );
setContentView(R.layout.activity_main_activity);
}
@Override
public void onBackPressed() {
super.onBackPressed();
finishAfterTransition();
}
Style-v21.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="BaseAppTheme" parent="android:Theme.Material.Light">
<item name="android:colorControlHighlight">#0000AA</item>
<item name="android:navigationBarColor">#0000AA</item>
<item name="android:colorPrimaryDark">#0000AA</item>
<item name="android:colorPrimary">#0000FF</item>
<item name="android:colorAccent">#00FF00</item>
<item name="android:windowBackground">@android:color/black</item>
<item name="android:textColorPrimary">@android:color/white</item>
<item name="android:windowContentTransitions">true</item>
<item name="android:windowAllowEnterTransitionOverlap">true</item>
<!-- specify enter and exit transitions -->
<item name="android:windowEnterTransition">@transition/explode</item>
<item name="android:windowExitTransition">@transition/explode</item>
</style>
</resources>