Undersanding animation function in android

眉间皱痕 提交于 2020-01-15 09:14:09

问题


I want to use the following code snippet, please help me in understanding the given functions or suggest me online documentation that can I use.

view.animate().setDuration(2000).alpha(0)
        .withEndAction(new Runnable() {
          @Override
          public void run() {
            list.remove(item);
            adapter.notifyDataSetChanged();
            view.setAlpha(1);
          }
      });

what does function setDuration(2000) , .alpha(0) ,.alpha(1) and .withEndAction()


回答1:


  • setDuration(2000) sets the duration of the animation to 2000 milliseconds or 2 seconds
  • alpha(0) the view's alpha property will be animated to this value
  • withEndAction() means at the end of the animation the following action will take place

Have a look here (http://developer.android.com/reference/android/view/ViewPropertyAnimator.html)




回答2:


check this post, you can understand better

http://developer.android.com/guide/topics/graphics/prop-animation.html



来源:https://stackoverflow.com/questions/17021991/undersanding-animation-function-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!