I have this working code in my AsyncTasks class.
protected void onProgressUpdate(Object... values) { View view = (View) values[0]; view_group.addView(view); view.animate().y(500).setDuration(1000); }
I tried changing the code to this:
protected void onProgressUpdate(Object... values) { View view = (View) values[0]; view_group.addView(view); ValueAnimator va = ObjectAnimator.ofInt(view, "y", 500); va.setDuration(1000); va.start(); }
The view appears, but is not animated.
What am I missing?
Edit:
I also tried to put the ValueAnimator code inside the AnimatorListener (with different coordinates, of course), so it will run after the first animation finishes, but that didn't work.
source share