How to make smooth, more spectacular transitions from one Activity to another?
- How much fantasy is enough. :) - And
|
1 answer
Define transition animation. For example:
res / anim / slidein.xml
<?xml version="1.0" encoding="utf-8"?> <translate xmlns:android="http://schemas.android.com/apk/res/android" android:fromYDelta="100%p" android:toYDelta="0%p" android:duration="@android:integer/config_longAnimTime"/> res / anim / slideout.xml
<?xml version="1.0" encoding="utf-8"?> <translate xmlns:android="http://schemas.android.com/apk/res/android" android:fromYDelta="0%p" android:toYDelta="-100%p" android:duration="@android:integer/config_longAnimTime"/> SomeActivity.java
Intent intent = new Intent(this, OtherActivity.class); startActivity(intent); overridePendingTransition(R.anim.slidein, R.anim.slideout); |