public class MainActivity extends AppCompatActivity {
private ImageView imageview;
private LinearLayout ly_root;
private int width;
private int height;
private Intent intent;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
imageview = findViewById(R.id.imageview);
ly_root = findViewById(R.id.ly_root);
width = ly_root.getWidth();
height = ly_root.getHeight();
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(imageview, "translationY", imageview.getTranslationY(), 800);
ObjectAnimator objectAnimator1 = ObjectAnimator.ofFloat(imageview, "rotation", 0, 360);
ObjectAnimator objectAnimator2 = ObjectAnimator.ofFloat(imageview, "alpha", 0, 1, 0, 1);
ObjectAnimator ObjectAnimator3 = ObjectAnimator.ofFloat(imageview, "scaleX", 0, 1);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.play(objectAnimator).with(objectAnimator1).with(objectAnimator2);
animatorSet.setDuration(5000);
animatorSet.start();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
intent = new Intent(MainActivity.this, SentedActivity.class);
startActivity(intent);
}
}, 5000);
}
}