本文整理汇总了Java中android.animation.ValueAnimator.isRunning方法的典型用法代码示例。如果您正苦于以下问题:Java ValueAnimator.isRunning方法的具体用法?Java ValueAnimator.isRunning怎么用?Java ValueAnimator.isRunning使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.animation.ValueAnimator
的用法示例。
在下文中一共展示了ValueAnimator.isRunning方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decelerate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
public void decelerate() {
if (mAccelerateAnimator != null && mAccelerateAnimator.isRunning()) {
mAccelerateAnimator.cancel();
}
if (mFlushRate == FLUSH_RATE) return;
ValueAnimator animator = getDecelerateAnimator();
if (animator.isRunning()) animator.cancel();
long duration = (long) (((float) FLUSH_RATE - mFlushRate) / FLUSH_RATE * 1000);
if (duration == 0) {
mFlushRate = FLUSH_RATE;
return;
}
animator.setDuration(duration);
animator.setFloatValues(mFlushRate, FLUSH_RATE);
animator.start();
}
示例2: play
import android.animation.ValueAnimator; //导入方法依赖的package包/类
public void play() {
ValueAnimator animator = getAnimator();
if (animator.isRunning()) {
return;
}
animator.start();
}
示例3: isRunning
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public boolean isRunning() {
for (ValueAnimator animator : mAnimators) {
return animator.isRunning();
}
return false;
}
示例4: accelerate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
public void accelerate() {
if (mFlushRate == FLUSH_RATE_LIMITATION) return;
mFlushRate = FLUSH_RATE; // reset flush rate
ValueAnimator animator = getAccelerateAnimator();
if (animator.isRunning()) animator.cancel();
animator.setFloatValues(mFlushRate, FLUSH_RATE_LIMITATION);
animator.start();
}
示例5: isRunning
import android.animation.ValueAnimator; //导入方法依赖的package包/类
public static boolean isRunning(ValueAnimator animator) {
return animator != null && animator.isRunning();
}