android.animation.ObjectAnimator.setRepeatMode()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(310)

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

ObjectAnimator.setRepeatMode介绍

暂无

代码示例

代码示例来源:origin: aa112901/remusic

mNeedleAnim = ObjectAnimator.ofFloat(mNeedle, "rotation", -30, 0);
mNeedleAnim.setDuration(200);
mNeedleAnim.setRepeatMode(0);
mNeedleAnim.setInterpolator(new LinearInterpolator());

代码示例来源:origin: jaydenxiao2016/AndroidFire

objectAnimator1.setRepeatMode(ValueAnimator.INFINITE);
objectAnimator2.setRepeatMode(ValueAnimator.INFINITE);
objectAnimator3.setRepeatMode(ValueAnimator.INFINITE);

代码示例来源:origin: aa112901/remusic

mNeedleAnim.setRepeatMode(0);
mNeedleAnim.setInterpolator(new LinearInterpolator());

代码示例来源:origin: stackoverflow.com

ObjectAnimator scaleDown = ObjectAnimator.ofPropertyValuesHolder(ImageView,
         PropertyValuesHolder.ofFloat("scaleX", 1.2f),
         PropertyValuesHolder.ofFloat("scaleY", 1.2f));
     scaleDown.setDuration(310);
     scaleDown.setRepeatCount(ObjectAnimator.INFINITE);
     scaleDown.setRepeatMode(ObjectAnimator.REVERSE);
     scaleDown.start();

代码示例来源:origin: mayubao/KuaiChuan

private ObjectAnimator create(View target, String propertyName, int repeatCount, long delay, float from, float to) {
  ObjectAnimator animator = ObjectAnimator.ofFloat(target, propertyName, from, to);
  animator.setRepeatCount(repeatCount);
  animator.setRepeatMode(ObjectAnimator.RESTART);
  animator.setStartDelay(delay);
  return animator;
}

代码示例来源:origin: glomadrian/RoadRunner

@OnClick(R.id.runButton)
public void runButtonClick() {
  if (infiniteAnimator == null) {
    infiniteAnimator = ObjectAnimator.ofInt(roadRunner, ProgressRoadRunner.PROGRESS, 100);
    infiniteAnimator.setDuration(1000);
    infiniteAnimator.setRepeatMode(ObjectAnimator.RESTART);
    infiniteAnimator.setRepeatCount(ObjectAnimator.INFINITE);
    infiniteAnimator.setInterpolator(new FastOutSlowInInterpolator());
  }
  infiniteAnimator.start();
}

代码示例来源:origin: stackoverflow.com

ObjectAnimator colorAnim = ObjectAnimator.ofInt(myButton, "textColor", Color.RED, Color.TRANSPARENT); 
colorAnim.setDuration(1000); 
colorAnim.setEvaluator(new ArgbEvaluator());     
colorAnim.setRepeatCount(ValueAnimator.INFINITE); 
colorAnim.setRepeatMode(ValueAnimator.REVERSE); 
colorAnim.start();

代码示例来源:origin: chaychan/TouTiao

ObjectAnimator loadAnimator = ObjectAnimator.ofFloat(imageViewList.get(i), "alpha", new float[]{1.0F, 0.5F}).setDuration(500L);
loadAnimator.setStartDelay(100 * i);
loadAnimator.setRepeatMode(ObjectAnimator.REVERSE);
loadAnimator.setRepeatCount(-1);
animatorList.add(loadAnimator);

代码示例来源:origin: OCNYang/Android-Animation-Set

/**
 * ObjectAnimator usage
 *
 * @param b
 * @return
 */
public ObjectAnimator getObjectAnimator(boolean b) {
  if (b) {
    ObjectAnimator bgColorAnimator = ObjectAnimator.ofArgb(mPuppet,
        "backgroundColor",
        0xff009688, 0xff795548);
    bgColorAnimator.setRepeatCount(1);
    bgColorAnimator.setDuration(3000);
    bgColorAnimator.setRepeatMode(ValueAnimator.REVERSE);
    bgColorAnimator.setStartDelay(0);
    return bgColorAnimator;
  } else {
    ObjectAnimator rotationXAnimator = ObjectAnimator.ofFloat(mPuppet,
        "rotationX",
        0f, 360f);
    rotationXAnimator.setRepeatCount(1);
    rotationXAnimator.setDuration(3000);
    rotationXAnimator.setRepeatMode(ValueAnimator.REVERSE);
    return rotationXAnimator;
  }
}

代码示例来源:origin: OCNYang/Android-Animation-Set

/**
 * ObjectAnimator: You can also create multiple animations by PropertyValuesHolder.
 * <p>
 * ValueAnimator has the same method, but we don't use it that way. #ValueAnimator.ofPropertyValuesHolder()#
 *
 * @return
 */
public Animator getObjectAnimatorByPropertyValuesHolder() {
  PropertyValuesHolder bgColorAnimator = PropertyValuesHolder.ofObject("backgroundColor",
      new ArgbEvaluator(),
      0xff009688, 0xff795548);
  PropertyValuesHolder rotationXAnimator = PropertyValuesHolder.ofFloat("rotationX",
      0f, 360f);
  ObjectAnimator objectAnimator = ObjectAnimator.ofPropertyValuesHolder(mPuppet, bgColorAnimator, rotationXAnimator);
  objectAnimator.setDuration(3000);
  objectAnimator.setRepeatCount(1);
  objectAnimator.setRepeatMode(ValueAnimator.REVERSE);
  return objectAnimator;
}

代码示例来源:origin: wooplr/Spotlight

ObjectAnimator lineAnim = ObjectAnimator.ofPropertyValuesHolder(
    this, pvMoveY, pvMoveX).setDuration(lineAnimDuration);
lineAnim.setRepeatMode(ValueAnimator.RESTART);
lineAnim.setRepeatCount(mAnimPoints.size() - 1);
lineAnim.addUpdateListener(this);

代码示例来源:origin: stackoverflow.com

PropertyValuesHolder scalex = PropertyValuesHolder.ofFloat(View.SCALE_X, 1.2f);
PropertyValuesHolder scaley = PropertyValuesHolder.ofFloat(View.SCALE_Y, 1.2f);
ObjectAnimator anim = ObjectAnimator.ofPropertyValuesHolder(btn_layer, scalex, scaley);
anim.setRepeatCount(ValueAnimator.INFINITE);
anim.setRepeatMode(ValueAnimator.REVERSE);
anim.setDuration(1500);
anim.start();

代码示例来源:origin: appwise-labs/NoInternetDialog

private void animateWifi() {
  wifiAnimator = ObjectAnimator.ofFloat(wifiIndicator, "alpha", 0f, 0.5f);
  wifiAnimator.setDuration(1500);
  wifiAnimator.setRepeatMode(ValueAnimator.RESTART);
  wifiAnimator.setRepeatCount(ValueAnimator.INFINITE);
  wifiAnimator.start();
}

代码示例来源:origin: mime-mob/AndroidAdvanceAnimation

public void startAnim4(View view) {
  final SectorView sectorView = (SectorView)findViewById(R.id.sector_view);
  anim4 = ObjectAnimator.ofFloat(sectorView, "fraction", 0, 1);
  anim4.setDuration(2000);
  anim4.setRepeatCount(ValueAnimator.INFINITE);
  anim4.setRepeatMode(ValueAnimator.RESTART);
  anim4.start();
}

代码示例来源:origin: mime-mob/AndroidAdvanceAnimation

public void startAnim1(View view) {
  ImageView iv = (ImageView) findViewById(R.id.iv_1);
  anim1 = ObjectAnimator.ofFloat(iv, "rotationY", 0, 359);
  anim1.setDuration(1000);
  anim1.setRepeatCount(1);
  anim1.setRepeatMode(ValueAnimator.REVERSE);
  anim1.start();
}

代码示例来源:origin: mime-mob/AndroidAdvanceAnimation

@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public PathAnimator loop(boolean loop) {
  checkObj();
  animator.setRepeatCount(ValueAnimator.INFINITE);
  animator.setRepeatMode(ValueAnimator.RESTART);
  return this;
}

代码示例来源:origin: Appolica/Flubber

@Override
  protected void setupRepeating(Animator animation, AnimationBody animationBody) {
    ((ObjectAnimator) animation).setRepeatCount(animationBody.getRepeatCount() * 2 + 1);
    ((ObjectAnimator) animation).setRepeatMode(ValueAnimator.REVERSE);
  }
}

代码示例来源:origin: Appolica/Flubber

@Override
  protected void setupRepeating(Animator animation, AnimationBody animationBody) {
    int repeatCount = animationBody.getRepeatCount();
    if (repeatCount == 0) {
      repeatCount = 3;
    } else {
      repeatCount *= 3;
    }

    ((ObjectAnimator) animation).setRepeatCount(repeatCount);
    ((ObjectAnimator) animation).setRepeatMode(ValueAnimator.REVERSE);
  }
}

代码示例来源:origin: mime-mob/AndroidAdvanceAnimation

public PropertyAnimator repeat(int count, int repeatMode) {
  checkObj();
  animator.setRepeatCount(count);
  animator.setRepeatMode(repeatMode);
  return this;
}

代码示例来源:origin: tajchert/WaitingDots

private ObjectAnimator createDotJumpAnimator(JumpingSpan jumpingSpan, long delay) {
  ObjectAnimator jumpAnimator = ObjectAnimator.ofFloat(jumpingSpan, "translationY", 0, -jumpHeight);
  jumpAnimator.setEvaluator(new SinTypeEvaluator());
  jumpAnimator.setDuration(period);
  jumpAnimator.setStartDelay(delay);
  jumpAnimator.setRepeatCount(ValueAnimator.INFINITE);
  jumpAnimator.setRepeatMode(ValueAnimator.RESTART);
  return jumpAnimator;
}

相关文章