I am animating an ImageView by scaleX. This is supposed to be a progress bar which fills from left to right. It works without problem om API 10 and API 18,19. But on API 16 there seems to be a problem with the setPivotX. I have tried every option in NineOldAndroids: set view pivot .
final ImageView progressBarFill = (ImageView) getView().findViewById(R.id.progressbarImageFill);
...
ViewHelper.setPivotX(progressBarFill, 0);
AnimatorProxy.wrap(progressBarFill).setPivotX(0);
animate(progressBarFill).setDuration(1000).scaleX(0.25f);
and
AnimatorSet set = new AnimatorSet();
set.playTogether(
ObjectAnimator.ofFloat(progressBarFill, "scaleX", 0f, 0.25f)
);
AnimatorProxy.wrap(progressBarFill).setPivotX(0.0f);
ViewHelper.setPivotX(progressBarFill, 0f);
set.setDuration(1000).start();
The animation works but it animates from the center ot the ImageView. Can anyone confirm this issue?
0 comments:
Post a Comment