WindowEnterTransition Not Affecting Activity Trans

2019-06-26 10:31发布

问题:

While windowExitTransition is working as expected I cannot get windowEnterTransition to work:

themes.xml

 <item name="android:windowEnterTransition">@android:transition/explode</item>
 <item name="android:windowExitTransition">@android:transition/explode</item>

MainActivity.java

Intent intent = new Intent(MainActivity.this, SubjectActivity.class);
startActivity(intent, ActivityOptionsCompat.makeSceneTransitionAnimation(MainActivity.this).toBundle());

Demo

回答1:

Are you sure that both activities have applied the same theme with the specified transitions from above?



回答2:

for example: Activity A - > Activity B if you want to set a explode transition between these activity. you should at least specify

<item name="android:windowExitTransition">@android:transition/explode</item> in the A's theme

and specify

<item name="android:windowEnterTransition">@android:transition/explode</item> in the B's theme.

so that you can see what you want now.