Code example for ValueAnimator

Methods: addUpdateListener

0
    private static ViewTreeObserver.OnDrawListener sGlobalDrawListener;
    private static long sGlobalFrameCounter;
 
    public FirstFrameAnimatorHelper(ValueAnimator animator, View target) {
        mTarget = target;
        animator.addUpdateListener(this);
    } 
 
    public FirstFrameAnimatorHelper(ViewPropertyAnimator vpa, View target) {
        mTarget = target;
        vpa.setListener(new AnimatorListenerAdapter() {
                public void onAnimationStart (Animator animation) {
                    final ValueAnimator va = (ValueAnimator) animation;
                    va.addUpdateListener(FirstFrameAnimatorHelper.this);
                    onAnimationUpdate(va);
                } 
            }); 
    } 
 
    public static void initializeDrawListener(View view) {
        if (sGlobalDrawListener != null) {