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


Java Animator.cancel方法代码示例

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


在下文中一共展示了Animator.cancel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cancel

import com.nineoldandroids.animation.Animator; //导入方法依赖的package包/类
@Override
public void cancel() {
    if (mAnimatorMap.size() > 0) {
        HashMap<Animator, PropertyBundle> mAnimatorMapCopy =
                (HashMap<Animator, PropertyBundle>)mAnimatorMap.clone();
        Set<Animator> animatorSet = mAnimatorMapCopy.keySet();
        for (Animator runningAnim : animatorSet) {
            runningAnim.cancel();
        }
    }
    mPendingAnimations.clear();
    View v = mView.get();
    if (v != null) {
        v.removeCallbacks(mAnimationStarter);
    }
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:17,代码来源:ViewPropertyAnimatorHC.java

示例2: animatePropertyBy

import com.nineoldandroids.animation.Animator; //导入方法依赖的package包/类
private void animatePropertyBy(int constantName, float startValue, float byValue) {
    if (this.mAnimatorMap.size() > 0) {
        Animator animatorToCancel = null;
        for (Animator runningAnim : this.mAnimatorMap.keySet()) {
            PropertyBundle bundle = (PropertyBundle) this.mAnimatorMap.get(runningAnim);
            if (bundle.cancel(constantName) && bundle.mPropertyMask == 0) {
                animatorToCancel = runningAnim;
                break;
            }
        }
        if (animatorToCancel != null) {
            animatorToCancel.cancel();
        }
    }
    this.mPendingAnimations.add(new NameValuesHolder(constantName, startValue, byValue));
    View v = (View) this.mView.get();
    if (v != null) {
        v.removeCallbacks(this.mAnimationStarter);
        v.post(this.mAnimationStarter);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:22,代码来源:ViewPropertyAnimatorHC.java

示例3: cancel

import com.nineoldandroids.animation.Animator; //导入方法依赖的package包/类
@Override
public void cancel() {
    Animator a = mAnimator.get();
    if (a != null) {
        a.cancel();
    }
}
 
开发者ID:SimonCherryGZ,项目名称:JewelryUI,代码行数:8,代码来源:SupportAnimatorPreL.java

示例4: animatePropertyBy

import com.nineoldandroids.animation.Animator; //导入方法依赖的package包/类
/**
 * Utility function, called by animateProperty() and animatePropertyBy(), which handles the
 * details of adding a pending animation and posting the request to start the animation.
 *
 * @param constantName The specifier for the property being animated
 * @param startValue The starting value of the property
 * @param byValue The amount by which the property will change
 */
private void animatePropertyBy(int constantName, float startValue, float byValue) {
    // First, cancel any existing animations on this property
    if (mAnimatorMap.size() > 0) {
        Animator animatorToCancel = null;
        Set<Animator> animatorSet = mAnimatorMap.keySet();
        for (Animator runningAnim : animatorSet) {
            PropertyBundle bundle = mAnimatorMap.get(runningAnim);
            if (bundle.cancel(constantName)) {
                // property was canceled - cancel the animation if it's now empty
                // Note that it's safe to break out here because every new animation
                // on a property will cancel a previous animation on that property, so
                // there can only ever be one such animation running.
                if (bundle.mPropertyMask == NONE) {
                    // the animation is no longer changing anything - cancel it
                    animatorToCancel = runningAnim;
                    break;
                }
            }
        }
        if (animatorToCancel != null) {
            animatorToCancel.cancel();
        }
    }

    NameValuesHolder nameValuePair = new NameValuesHolder(constantName, startValue, byValue);
    mPendingAnimations.add(nameValuePair);
    View v = mView.get();
    if (v != null) {
        v.removeCallbacks(mAnimationStarter);
        v.post(mAnimationStarter);
    }
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:41,代码来源:ViewPropertyAnimatorHC.java

示例5: cancel

import com.nineoldandroids.animation.Animator; //导入方法依赖的package包/类
public void cancel() {
    if (this.mAnimatorMap.size() > 0) {
        for (Animator runningAnim : ((HashMap) this.mAnimatorMap.clone()).keySet()) {
            runningAnim.cancel();
        }
    }
    this.mPendingAnimations.clear();
    View v = (View) this.mView.get();
    if (v != null) {
        v.removeCallbacks(this.mAnimationStarter);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:13,代码来源:ViewPropertyAnimatorHC.java


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