public S hasRepeatCount(int count) { isNotNull(); int actualCount = actual.getRepeatCount(); assertThat(actualCount) // .overridingErrorMessage("Expected repeat count <%s> but was <%s>.", repeatCountToString(count), repeatCountToString(actualCount)) // .isEqualTo(count); return myself; }
@Override public void run() { // Abort if start time has been messed with, as this simulation is only designed to handle // standard situations. if ((animation.getStartTime() == startTime && animation.getStartOffset() == startOffset) && animation.getTransformation(startTime == Animation.START_ON_FIRST_FRAME ? SystemClock.uptimeMillis() : (startTime + startOffset + elapsedTime), new Transformation()) && // We can't handle infinitely repeating animations in the current scheduling model, // so abort after one iteration. !(animation.getRepeatCount() == Animation.INFINITE && elapsedTime >= animation.getDuration())) { // Update startTime if it had a value of Animation.START_ON_FIRST_FRAME startTime = animation.getStartTime(); elapsedTime += ShadowChoreographer.getFrameInterval() / TimeUtils.NANOS_PER_MS; ShadowChoreographer.getInstance().postCallback(Choreographer.CALLBACK_ANIMATION, this, null); } else { animationRunner = null; } } }
@Override public long getDuration() { long duration = 0; for (Animation animation : animations) { if(animation.getRepeatCount()!=INFINITE){ duration += animation.getRepeatCount()*animation.getDuration(); }else { return INFINITE; } } return duration; }
public S hasRepeatCount(int count) { isNotNull(); int actualCount = actual.getRepeatCount(); assertThat(actualCount) // .overridingErrorMessage("Expected repeat count <%s> but was <%s>.", repeatCountToString(count), repeatCountToString(actualCount)) // .isEqualTo(count); return myself; }
@Override public void run() { // Abort if start time has been messed with, as this simulation is only designed to handle // standard situations. if ((animation.getStartTime() == startTime && animation.getStartOffset() == startOffset) && animation.getTransformation(startTime == Animation.START_ON_FIRST_FRAME ? SystemClock.uptimeMillis() : (startTime + startOffset + elapsedTime), new Transformation()) && // We can't handle infinitely repeating animations in the current scheduling model, // so abort after one iteration. !(animation.getRepeatCount() == Animation.INFINITE && elapsedTime >= animation.getDuration())) { // Update startTime if it had a value of Animation.START_ON_FIRST_FRAME startTime = animation.getStartTime(); elapsedTime += ShadowChoreographer.getFrameInterval() / TimeUtils.NANOS_PER_MS; ShadowChoreographer.getInstance().postCallback(Choreographer.CALLBACK_ANIMATION, this, null); } else { animationRunner = null; } } }
@Override public void run() { // Abort if start time has been messed with, as this simulation is only designed to handle // standard situations. if ((animation.getStartTime() == startTime && animation.getStartOffset() == startOffset) && animation.getTransformation(startTime == Animation.START_ON_FIRST_FRAME ? SystemClock.uptimeMillis() : (startTime + startOffset + elapsedTime), new Transformation()) && // We can't handle infinitely repeating animations in the current scheduling model, // so abort after one iteration. !(animation.getRepeatCount() == Animation.INFINITE && elapsedTime >= animation.getDuration())) { // Update startTime if it had a value of Animation.START_ON_FIRST_FRAME startTime = animation.getStartTime(); elapsedTime += ShadowChoreographer.getFrameInterval() / TimeUtils.NANOS_PER_MS; ShadowChoreographer.getInstance().postCallback(Choreographer.CALLBACK_ANIMATION, this, null); } else { animationRunner = null; } } }
@Override public void run() { // Abort if start time has been messed with, as this simulation is only designed to handle // standard situations. if ((animation.getStartTime() == startTime && animation.getStartOffset() == startOffset) && animation.getTransformation(startTime == Animation.START_ON_FIRST_FRAME ? SystemClock.uptimeMillis() : (startTime + startOffset + elapsedTime), new Transformation()) && // We can't handle infinitely repeating animations in the current scheduling model, // so abort after one iteration. !(animation.getRepeatCount() == Animation.INFINITE && elapsedTime >= animation.getDuration())) { // Update startTime if it had a value of Animation.START_ON_FIRST_FRAME startTime = animation.getStartTime(); elapsedTime += ShadowChoreographer.getFrameInterval() / TimeUtils.NANOS_PER_MS; ShadowChoreographer.getInstance().postCallback(Choreographer.CALLBACK_ANIMATION, this, null); } else { animationRunner = null; } } }
@Override public void run() { // Abort if start time has been messed with, as this simulation is only designed to handle // standard situations. if ((animation.getStartTime() == startTime && animation.getStartOffset() == startOffset) && animation.getTransformation(startTime == Animation.START_ON_FIRST_FRAME ? SystemClock.uptimeMillis() : (startTime + startOffset + elapsedTime), new Transformation()) && // We can't handle infinitely repeating animations in the current scheduling model, // so abort after one iteration. !(animation.getRepeatCount() == Animation.INFINITE && elapsedTime >= animation.getDuration())) { // Update startTime if it had a value of Animation.START_ON_FIRST_FRAME startTime = animation.getStartTime(); elapsedTime += ShadowChoreographer.getFrameInterval() / TimeUtils.NANOS_PER_MS; ShadowChoreographer.getInstance().postCallback(Choreographer.CALLBACK_ANIMATION, this, null); } else { animationRunner = null; } } }