com.nineoldandroids.animation.ObjectAnimator.cancel()方法的使用及代码示例

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

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

ObjectAnimator.cancel介绍

暂无

代码示例

代码示例来源:origin: navasmdc/MaterialDesignLibrary

/**
 * Stop indeterminate animation to convert view in determinate progress bar
 */
private void stopIndeterminate(){
  animation.cancel();
  ViewHelper.setX(progressView,0);
  runAnimation = false;
}

代码示例来源:origin: chiemy/LoadingImageView

private void stopAnim(){
  if(animator != null){
    animator.cancel();
  }
}

代码示例来源:origin: NEYouFan/ht-refreshrecyclerview

@Override
public void onRefreshComplete() {
  if (animator != null && animator.isRunning()) {
    animator.cancel();
  }
}

代码示例来源:origin: NEYouFan/ht-refreshrecyclerview

@Override
public void onRefreshComplete() {
  if (animator != null && animator.isRunning()) {
    animator.cancel();
  }
}

代码示例来源:origin: NEYouFan/ht-refreshrecyclerview

@Override
public void onRefreshComplete() {
  if (animator != null && animator.isRunning()) {
    animator.cancel();
  }
}

代码示例来源:origin: NEYouFan/ht-refreshrecyclerview

@Override
public void onRefreshComplete() {
  if (animator != null && animator.isRunning()) {
    animator.cancel();
  }
}

代码示例来源:origin: Leaking/WeGit

public void setIconState(IconState iconState) {
  synchronized (lock) {
    if (transformationRunning) {
      transformation.cancel();
      transformationRunning = false;
    }
    if (currentIconState == iconState) return;
    switch (iconState) {
      case BURGER:
        animationState = AnimationState.BURGER_ARROW;
        transformationValue = TRANSFORMATION_START;
        break;
      case ARROW:
        animationState = AnimationState.BURGER_ARROW;
        transformationValue = TRANSFORMATION_MID;
        break;
      case X:
        animationState = AnimationState.BURGER_X;
        transformationValue = TRANSFORMATION_MID;
        break;
      case CHECK:
        animationState = AnimationState.BURGER_CHECK;
        transformationValue = TRANSFORMATION_MID;
    }
    currentIconState = iconState;
    invalidateSelf();
  }
}

代码示例来源:origin: agxxxx/AIDLMusicPlayer

public void     next() {
  if (isPlaying) {
    startNeedleAnimator();
  }
  mDiscLayoutAnimator.cancel();
  isPlaying = false;
  reverseDiscAnimator();
}

代码示例来源:origin: canyinghao/CanEffect

@Override
  public void run() {
    if (ripple.isRunning()) {
      ripple.cancel();
    }
    isAnime = false;
    setRadius(0);
  }
}, 500);

代码示例来源:origin: agxxxx/AIDLMusicPlayer

public void pause() {
  if (!isPlaying) {
    return;
  }
  startNeedleAnimator();
  if (mDiscLayoutAnimator.isRunning() || mDiscLayoutAnimator.isStarted()) {
    mDiscLayoutAnimator.cancel();
  }
  isPlaying = false;
}

代码示例来源:origin: agxxxx/AIDLMusicPlayer

private void startNeedleAnimator() {
  if (isPlaying) {
    mNeedleAnimator = ObjectAnimator.ofFloat(mNeedle, "rotation", 0, NEEDLE_ROTATE_CIRCLE);
  } else {
    mNeedleAnimator = ObjectAnimator.ofFloat(mNeedle, "rotation", NEEDLE_ROTATE_CIRCLE, 0);
  }
  mNeedleAnimator.setDuration(NEEDLE_ANIMATOR_TIME);
  mNeedleAnimator.setInterpolator(new DecelerateInterpolator());
  if (mNeedleAnimator.isRunning() || mNeedleAnimator.isStarted()) {
    mNeedleAnimator.cancel();
  }
  mNeedleAnimator.start();
}

代码示例来源:origin: agxxxx/AIDLMusicPlayer

private void reverseDiscAnimator() {
  mDiscLayoutAnimator = ObjectAnimator.ofFloat(mDiscLayout, "rotation", mDiscLayoutAnimatorValue, 360);
  mDiscLayoutAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
    @Override
    public void onAnimationUpdate(ValueAnimator arg0) {
      mDiscLayoutAnimatorValue = (Float) arg0.getAnimatedValue();
    }
  });
  mDiscLayoutAnimator.setDuration(DISC_REVERSE_ANIMATOR_TIME);
  mDiscLayoutAnimator.setInterpolator(new AccelerateInterpolator());
  if (mDiscLayoutAnimator.isRunning() || mDiscLayoutAnimator.isStarted()) {
    mDiscLayoutAnimator.cancel();
  }
  mDiscLayoutAnimator.start();
}

代码示例来源:origin: darkskygit/VirtualApp

mRadiusAnimator.cancel();

代码示例来源:origin: agxxxx/AIDLMusicPlayer

private void startDiscAnimator(float animatedValue) {
  mDiscLayoutAnimator = ObjectAnimator.ofFloat(mDiscLayout, "rotation", animatedValue, 360 + animatedValue);
  mDiscLayoutAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
    @Override
    public void onAnimationUpdate(ValueAnimator arg0) {
      mDiscLayoutAnimatorValue = (Float) arg0.getAnimatedValue();
    }
  });
  mDiscLayoutAnimator.setDuration(DISC_ANIMATOR_TIME);
  mDiscLayoutAnimator.setRepeatCount(DISC_ANIMATOR_REPEAT_COUNT);
  mDiscLayoutAnimator.setInterpolator(new LinearInterpolator());
  if (mDiscLayoutAnimator.isRunning() || mDiscLayoutAnimator.isStarted()) {
    mDiscLayoutAnimator.cancel();
  }
  mDiscLayoutAnimator.start();
}

代码示例来源:origin: Leaking/WeGit

@Override public void start() {
  if (transformationRunning) return;
  if (animatingIconState != null && animatingIconState != currentIconState) {
    transformationRunning = true;
    final boolean direction = resolveTransformation();
    transformation.setFloatValues(
      direction ? TRANSFORMATION_START : TRANSFORMATION_MID,
      direction ? TRANSFORMATION_MID : TRANSFORMATION_END
    );
    transformation.start();
  }
  if (pressedCircle.isRunning()) {
    pressedCircle.cancel();
  }
  if (drawTouchCircle && !neverDrawTouch) {
    pressedCircle.setFloatValues(0, circleRadius * 1.22f);
    pressedCircle.start();
  }
  invalidateSelf();
}

代码示例来源:origin: NEYouFan/ht-refreshrecyclerview

@Override
public void onRefreshing() {
  mRefreshLoadView.setPivotX(0.5f * mRefreshLoadView.getMeasuredWidth());
  mRefreshLoadView.setPivotY(0.5f * mRefreshLoadView.getMeasuredHeight());
  if (animator == null) {
    animator = ObjectAnimator.ofFloat(mRefreshLoadView, "rotation", 0.0f, 360.0f);
    animator.setDuration(1000);
    animator.setRepeatCount(ValueAnimator.INFINITE);
    animator.setRepeatMode(ValueAnimator.RESTART);
  }
  if (animator.isRunning()) animator.cancel();
  animator.start();
}

代码示例来源:origin: NEYouFan/ht-refreshrecyclerview

@Override
public void onRefreshing() {
  mRefreshLoadView.setPivotX(0.5f * mRefreshLoadView.getMeasuredWidth());
  mRefreshLoadView.setPivotY(0.5f * mRefreshLoadView.getMeasuredHeight());
  if (animator == null) {
    animator = ObjectAnimator.ofFloat(mRefreshLoadView, "rotation", 0.0f, 360.0f);
    animator.setDuration(1000);
    animator.setRepeatCount(ValueAnimator.INFINITE);
    animator.setRepeatMode(ValueAnimator.RESTART);
  }
  if (animator.isRunning()) animator.cancel();
  animator.start();
}

代码示例来源:origin: NEYouFan/ht-refreshrecyclerview

@Override
public void onRefreshing() {
  mRefreshLoadView.setPivotX(0.5f * mRefreshLoadView.getMeasuredWidth());
  mRefreshLoadView.setPivotY(0.5f * mRefreshLoadView.getMeasuredHeight());
  if (animator == null) {
    animator = ObjectAnimator.ofFloat(mRefreshLoadView, "rotation", 0.0f, 360.0f);
    animator.setDuration(1000);
    animator.setRepeatCount(ValueAnimator.INFINITE);
    animator.setRepeatMode(ValueAnimator.RESTART);
  }
  if (animator.isRunning()) animator.cancel();
  animator.start();
}

代码示例来源:origin: NEYouFan/ht-refreshrecyclerview

@Override
public void onRefreshing() {
  mRefreshLoadView.setPivotX(0.5f * mRefreshLoadView.getMeasuredWidth());
  mRefreshLoadView.setPivotY(0.5f * mRefreshLoadView.getMeasuredHeight());
  if (animator == null) {
    animator = ObjectAnimator.ofFloat(mRefreshLoadView, "rotation", 0.0f, 360.0f);
    animator.setDuration(1000);
    animator.setRepeatCount(ValueAnimator.INFINITE);
    animator.setRepeatMode(ValueAnimator.RESTART);
  }
  if (animator.isRunning()) animator.cancel();
  animator.start();
}

代码示例来源:origin: posm/OpenMapKitAndroid

/**
 * Stops a running animation.
 */
public void stopAnimation(final boolean jumpToTarget) {
  if (!mMapView.getScroller().isFinished()) {
    if (jumpToTarget) {
      mMapView.mIsFlinging = false;
      mMapView.getScroller().abortAnimation();
      setCenter(animateToTargetPoint);
    } else {
      stopPanning();
    }
  }
  // We ignore the jumpToTarget for zoom levels since it doesn't make sense to stop
  // the animation in the middle. Maybe we could have it cancel the zoom operation and jump
  // back to original zoom level?
  if (mMapView.isAnimating()) {
    if (mCurrentAnimation != null) {
      mCurrentAnimation.cancel();
    }
    mMapView.setZoomInternal(mMapView.getAnimatedZoom());
    if (jumpToTarget && zoomOnLatLong != null) {
      goTo(zoomOnLatLong, zoomDeltaScroll);
    }
    mMapView.setIsAnimating(false);
  }
}

相关文章