Shouldn't the width change after I animate the scaleX property? I noticed that the clickable area shrinks when I reduce the views width, so I guess the width must be adapted. But when I call view.getWidth() I still get the initial value.
Log.d(TAG, "" + getWidth()); //Initial value
setPivotX(getWidth() / 2);
ObjectAnimator animator = ObjectAnimator.ofFloat(this, View.SCALE_X, 1.0f, 0.8f);
animator.setInterpolator(new DecelerateInterpolator(1));
animator.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
Log.d(TAG, "" + getWidth()); //Initial value :(
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
animator.start();