////@Override public override void start() { if (mStarted) { return; } mStarted = true; mLastTime = SystemClock.UptimeMillis(); mChoreographer.RemoveFrameCallback(mFrameCallback); mChoreographer.PostFrameCallback(mFrameCallback); }
public ChoreographerAndroidSpringLooper(Choreographer choreographer) { mChoreographer = choreographer; mFrameCallback = new XFrameCallBack() { doFrame = (frameTimeNanos) => { if (!mStarted || mSpringSystem == null) { return; } long currentTime = SystemClock.UptimeMillis(); mSpringSystem.loop(currentTime - mLastTime); mLastTime = currentTime; mChoreographer.PostFrameCallback(mFrameCallback); } }; }