Ejemplo n.º 1
0
 private void start() {
   startTime = animation.getStartTime();
   startOffset = animation.getStartOffset();
   Choreographer choreographer = ShadowChoreographer.getInstance();
   if (animationRunner != null) {
     choreographer.removeCallbacks(Choreographer.CALLBACK_ANIMATION, animationRunner, null);
   }
   animationRunner = this;
   int startDelay;
   if (startTime == Animation.START_ON_FIRST_FRAME) {
     startDelay = (int) startOffset;
   } else {
     startDelay = (int) ((startTime + startOffset) - SystemClock.uptimeMillis());
   }
   choreographer.postCallbackDelayed(Choreographer.CALLBACK_ANIMATION, this, null, startDelay);
 }