Code example for TimeAnimator

Methods: setTimeListenerstart

0
    } 
 
    private void animationTick(long dtms) {
        if (!mTimeAnimator.isStarted()) {
            // XXX HAX to work around bug in TimeAnimator.end() not resetting its last time 
            mTimeAnimator = new TimeAnimator();
            mTimeAnimator.setTimeListener(mAnimationCallback);
 
            if (mPeekAnimator != null) mPeekAnimator.cancel();
 
            mTimeAnimator.start();
 
            mRubberbanding = mRubberbandingEnabled // is it enabled at all?
                    && mExpandedHeight > getFullHeight() // are we past the end?
                    && mVel >= -mFlingGestureMinDistPx; // was this not possibly a "close" gesture?
            if (mRubberbanding) {
                mClosing = true;
            } else if (mVel == 0) {
                // if the panel is less than halfway open, close it 
                mClosing = (mFinalTouchY / getFullHeight()) < 0.5f;
            } else {