问题
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 secondsalpha(0)the view's alpha property will be animated to this valuewithEndAction()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