Shouldn't the width be changed after I animate the scaleX property? I noticed that the click area decreases when I decrease the width of the views, so I assume that the width should be adapted. But when I call view.getWidth (), I still get the initial value.
Log.d(TAG, "" + getWidth());
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());
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
animator.start();
source
share