当前位置: 首页>>代码示例>>Java>>正文


Java ValueAnimator.cancel方法代码示例

本文整理汇总了Java中android.animation.ValueAnimator.cancel方法的典型用法代码示例。如果您正苦于以下问题:Java ValueAnimator.cancel方法的具体用法?Java ValueAnimator.cancel怎么用?Java ValueAnimator.cancel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.animation.ValueAnimator的用法示例。


在下文中一共展示了ValueAnimator.cancel方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
 
开发者ID:hsj-xiaokang,项目名称:OSchina_resources_android,代码行数:17,代码来源:SolarSystemView.java

示例2: stop

import android.animation.ValueAnimator; //导入方法依赖的package包/类
/**
 * Call this to explicitly stop opacity animation specified by {@code mType}.
 */
public void stop() {
    ValueAnimator animator;
    if (mOpacityValueAnimatorList != null) {
        for (int i = 0; i < mOpacityValueAnimatorList.size(); ++i) {
            animator = mOpacityValueAnimatorList.get(i);
            if (animator != null) {
                animator.cancel();
            }
        }
        mOpacityValueAnimatorList.clear();
    }

    if (mRippleEffectAnimator != null) {
        mRippleEffectAnimator.cancel();
        mRippleEffectAnimator = null;
    }
}
 
开发者ID:vulko,项目名称:AnimatedArcProgressView,代码行数:21,代码来源:OpacityAnimation.java

示例3: onAnimationUpdate

import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
    //移动图像并给出结果
    boolean result = scrollBy(mVector[0], mVector[1]);
    //衰减速度
    mVector[0] *= FLING_DAMPING_FACTOR;
    mVector[1] *= FLING_DAMPING_FACTOR;
    //速度太小或者不能移动了就结束
    if (!result || MathUtils.getDistance(0, 0, mVector[0], mVector[1]) < 1f) {
        animation.cancel();
    }
}
 
开发者ID:ZhouKanZ,项目名称:SweepRobot,代码行数:13,代码来源:PinchImageView.java

示例4: clearValueAnimator

import android.animation.ValueAnimator; //导入方法依赖的package包/类
public static void clearValueAnimator(ValueAnimator animator) {
    if (animator != null) {
        animator.removeAllListeners();
        animator.removeAllUpdateListeners();
        if (Build.VERSION.SDK_INT >= 19) {
            animator.pause();
        }
        animator.cancel();
    }
}
 
开发者ID:coopese,项目名称:qmui,代码行数:11,代码来源:QMUIViewHelper.java

示例5: 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();
}
 
开发者ID:hsj-xiaokang,项目名称:OSchina_resources_android,代码行数:9,代码来源:SolarSystemView.java

示例6: startValueAnimator

import android.animation.ValueAnimator; //导入方法依赖的package包/类
protected ValueAnimator startValueAnimator(ValueAnimator valueAnimator, float targetValue) {
    float originValue = targetValue;
    if (valueAnimator != null) {
        valueAnimator.cancel();
        originValue = (float) valueAnimator.getAnimatedValue();
    }

    valueAnimator = ValueAnimator.ofFloat(originValue, targetValue);
    valueAnimator.setDuration(200);
    valueAnimator.start();
    return valueAnimator;
}
 
开发者ID:neXenio,项目名称:BLE-Indoor-Positioning,代码行数:13,代码来源:BeaconLineChart.java

示例7: onAnimationUpdate

import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(final ValueAnimator valueAnimator) {
    // If the user is changing the slider, cancel the animation.
    if (mIsTracking) {
        valueAnimator.cancel();
        return;
    }

    final int animatedIntValue = (int) valueAnimator.getAnimatedValue();
    setProgress(animatedIntValue);
}
 
开发者ID:nazmulidris,项目名称:mediasession-mediaplayer,代码行数:12,代码来源:MediaSeekBar.java

示例8: cancelAnimation

import android.animation.ValueAnimator; //导入方法依赖的package包/类
private void cancelAnimation() {
    if (isInEditMode()) return;
    if (animators != null) {
        for (ValueAnimator valueAnimator : animators) {
            valueAnimator.cancel();
        }
        animators.clear();
        animators = null;
    }
}
 
开发者ID:vbohush,项目名称:geometric-progress-view,代码行数:11,代码来源:GeometricProgressView.java

示例9: clear

import android.animation.ValueAnimator; //导入方法依赖的package包/类
public void clear(){
    for (ValueAnimator animator : animators) {
        animator.cancel();
    }
    animators.clear();
}
 
开发者ID:florent37,项目名称:MyLittleCanvas,代码行数:7,代码来源:ShapeAnimator.java


注:本文中的android.animation.ValueAnimator.cancel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。