且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

动画结束后我该怎么做?

更新时间:2023-12-03 19:47:58

更现代的方法是使用 ViewPropertyAnimator:

The more modern way of doing this is to use the ViewPropertyAnimator:

view.animate()
    .alpha(0f)
    .withEndAction(new Runnable() {
      @Override
      public void run() {
        // Do something.
      }
    })
    .start();

或者,如果您使用的是 RetroLambda:

Or, if you're using RetroLambda:

view.animate()
    .alpha(0f)
    .withEndAction(() -> {
      // Do something.
    })
    .start();