M
M
Mikhail_1232019-07-19 13:58:05
Java
Mikhail_123, 2019-07-19 13:58:05

How to make sequential animation using animate()?

Hey! I want the Activity elements to become visible gradually and sequentially from top to bottom, so that only after one action is completed, another begins, it’s actually not clear how to do it sequentially, using the if conditional statement for some reason does not work (what’s in the code), you can use other options that I I know (Handler, CountDownTimer), but I strongly doubt the correctness of their use, tell me how to solve it correctly

private TextView textViewGoStart;
private ImageView imageViewLogoMain;

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  imageViewLogoMain = findViewById(R.id.imageViewLogoMain);
  textViewGoStart = findViewById(R.id.textViewGoStartMain);
  
  imageViewLogoMain.animate().alpha(1).setDuration(1000);
  if (imageViewLogoMain.getAlpha()==1){
    textViewGoStart.animate().alpha(1).setDuration(1000);
  }
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question