Esempio n. 1
0
 public Choreographer.IFrameCallback getFrameCallback()
 {
     if (mFrameCallback == null)
     {
         mFrameCallback = new XFrameCallBack()
         {
             doFrame = (frameTimeNanos) =>
             {
                 doFrame?.Invoke(frameTimeNanos);
             }
         };
     }
     return(mFrameCallback);
 }
Esempio n. 2
0
 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);
         }
     };
 }
Esempio n. 3
0
 // // @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
 private void choreographerRemoveFrameCallback(Choreographer.IFrameCallback frameCallback)
 {
     mChoreographer.RemoveFrameCallback(frameCallback);
 }
Esempio n. 4
0
 // // @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
 private void choreographerPostFrameCallbackDelayed(
     Choreographer.IFrameCallback frameCallback,
     long delayMillis)
 {
     mChoreographer.PostFrameCallbackDelayed(frameCallback, delayMillis);
 }
Esempio n. 5
0
 // // @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
 private void choreographerPostFrameCallback(Choreographer.IFrameCallback frameCallback)
 {
     mChoreographer.PostFrameCallback(frameCallback);
 }