ViewCompatでsetUpdateListenerを読んでも更新時に呼ばれない
調べてみた。
リファレンスでsetUpdateListenerを見るとなんと「Added in API level 19」でした。
ViewPropertyAnimator setUpdateListener
とくに警告も出ていなかったので気付かなかったー。
ObjectAnimatorを使用して解決しました。
ObjectAnimator animator = ObjectAnimator.ofFloat(v, View.ALPHA, v.getAlpha(), alpha);
animator.setDuration(duration);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
//処理
}
});
animator.start();