activity跳转爆炸动画
2018-04-03 本文已影响0人
西决_7e15
再startActivity的时候添加
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
context.startActivity(intent, ActivityOptions.makeSceneTransitionAnimation(activity). toBundle());
}else {
context.startActivity(intent);
}
再Activity中onCreate方法中super.onCreate(savedInstanceState);之前添加
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().setEnterTransition(new Explode().setDuration(500));
//此activity退出
getWindow().setExitTransition(new Explode().setDuration(500));
}else {
}