//图片一
img = (ImageView) findViewById(R.id.
img);
//图片二
img2 = (ImageView) findViewById(R.id.
img2);
//创建透明度动画
//图片一向左翻转
final ObjectAnimator alpha = ObjectAnimator.
ofFloat(
img,
"rotationY",
new float[]{
0f, -
90f});
final ObjectAnimator alpha2 = ObjectAnimator.
ofFloat(
img2,
"rotationY",
new float[]{
90f,
0f});
//图片一执行时间
alpha.setDuration(
1500);
alpha.start();
//图片二执行时间
alpha2.setDuration(
1500)
;
//图片二续借时间
alpha2.setStartDelay(
1400);
alpha2.start();
//图片二点击事件
alpha2.addListener(
new AnimatorListenerAdapter() {
@Override
//结束
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
//图片二结束进行跳转页面
Intent intent =
new Intent(MainActivity.
this,Main2Activity.
class);
startActivity(intent);
}
//开始
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
//图片二执行的时候进行显示
img2.setVisibility(View.
VISIBLE);
}
});