Search in sources :

Example 1 with TimeListener

use of android.animation.TimeAnimator.TimeListener in project chromeview by pwnall.

the class SmoothScroller method createJBRunnable.

private Runnable createJBRunnable() {
    // On JB, we rely on TimeAnimator to send events tied with vsync.
    return new Runnable() {

        @Override
        public void run() {
            mTimeAnimator = new TimeAnimator();
            mTimeAnimator.setTimeListener(new TimeListener() {

                @Override
                public void onTimeUpdate(TimeAnimator animation, long totalTime, long deltaTime) {
                    if (!sendEvent(mDownTime + totalTime)) {
                        mTimeAnimator.end();
                    }
                }
            });
            mTimeAnimator.start();
        }
    };
}
Also used : TimeListener(android.animation.TimeAnimator.TimeListener) TimeAnimator(android.animation.TimeAnimator)

Aggregations

TimeAnimator (android.animation.TimeAnimator)1 TimeListener (android.animation.TimeAnimator.TimeListener)1