Skip to content
This repository was archived by the owner on Apr 19, 2018. It is now read-only.
This repository was archived by the owner on Apr 19, 2018. It is now read-only.

setPivotX doesn't work on android 4.1.1 #77

@npersson

Description

@npersson

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 http://stackoverflow.com/questions/9496074/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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions