android.view.animation.Animation.getRepeatCount()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(129)

本文整理了Java中android.view.animation.Animation.getRepeatCount()方法的一些代码示例,展示了Animation.getRepeatCount()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Animation.getRepeatCount()方法的具体详情如下:
包路径:android.view.animation.Animation
类名称:Animation
方法名:getRepeatCount

Animation.getRepeatCount介绍

暂无

代码示例

代码示例来源:origin: square/assertj-android

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;
}

代码示例来源:origin: robolectric/robolectric

@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;
  }
 }
}

代码示例来源:origin: lltvcn/FreeText

@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;
}

代码示例来源:origin: com.squareup.assertj/assertj-android

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;
}

代码示例来源:origin: org.robolectric/shadows-core

@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;
  }
 }
}

代码示例来源:origin: org.robolectric/shadows-core-v23

@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;
  }
 }
}

代码示例来源:origin: org.robolectric/framework

@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;
  }
 }
}

代码示例来源:origin: org.robolectric/shadows-framework

@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;
  }
 }
}

相关文章

微信公众号

最新文章

更多