Open asafkin opened 9 years ago
you can try this:
final AnimatorSet mSetAnim = new AnimatorSet(); final Animator topAnim = ObjectAnimator.ofFloat(topImage, "translationY", (bmp.getHeight() / 2) * -1).setDuration(duration); final Animator bottomAnim = ObjectAnimator.ofFloat(bottomImage, "translationY", bmp.getHeight() / 2).setDuration(duration); mSetAnim.playTogether(topAnim, bottomAnim); mSetAnim.start();
in my phone, it doesn't work
I have created an animation which splits an image horizontaly and translate both parts in opposite direction :
final AnimatorSet mSetAnim = new AnimatorSet(); final Animator topAnim = ObjectAnimator.ofFloat(topImage, "translationY", (bmp.getHeight() / 2) * -1); final Animator bottomAnim = ObjectAnimator.ofFloat(bottomImage, "translationY", bmp.getHeight() / 2); mSetAnim.setDuration(duration); mSetAnim.playTogether(topAnim, bottomAnim); mSetAnim.start();
No matter what value i put in 'duration' it doesnt seem to have any affect. The animation duration stays the same - half a second more or less.