android.animation.TimeAnimator.TimeListener Java Examples

The following examples show how to use android.animation.TimeAnimator.TimeListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GenericTouchGesture.java    From android-chromium with BSD 2-Clause "Simplified" License 6 votes vote down vote up
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(mStartTime + totalTime)) {
                        mTimeAnimator.end();
                    }
                }
            });
            mTimeAnimator.start();
        }
    };
}
 
Example #2
Source File: GenericTouchGesture.java    From android-chromium with BSD 2-Clause "Simplified" License 6 votes vote down vote up
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(mStartTime + totalTime)) {
                        mTimeAnimator.end();
                    }
                }
            });
            mTimeAnimator.start();
        }
    };
}