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


Java AnimatorSet.play方法代码示例

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


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

示例1: setupAnimation

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
@Override
public void setupAnimation(@NonNull MenuItem mMenuItem, @NonNull TransitionControllerManager manager,
                           @IntRange(from = 0) int itemIndex, @IntRange(from = 0) int menuCount) {
    if(mDelayed!=null) {
        final int size = mDelayed.size();
        for (int i = 0; i < size; i++) {
            mDelayed.get(i).evaluate(manager.getTarget(), this);
        }
    }

    ObjectAnimator anim = new ObjectAnimator();
    anim.setValues(getValuesHolders());
    AnimatorSet set = new AnimatorSet();
    set.play(anim);
    set.setStartDelay((long) (itemIndex * mCascade * SCALE_FACTOR));
    set.setDuration((long) (SCALE_FACTOR - itemIndex * mCascade * SCALE_FACTOR));
    manager.addAnimatorSetAsTransition(set).setRange(mStart, mEnd);
}
 
开发者ID:kaichunlin,项目名称:android-transition,代码行数:19,代码来源:MenuItemTransitionBuilder.java

示例2: start

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void start() {
    if (canAnimate()) {
        clearAnimation();
    }
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.play(ObjectAnimator.ofFloat(this, "scaleX", 1.0f));
    animatorSet.play(ObjectAnimator.ofFloat(this, "scaleY", 1.0f));
    animatorSet.setInterpolator(new OvershootInterpolator());
    animatorSet.setDuration(getDuration());
    animatorSet.start();
}
 
开发者ID:Coffeeboys,项目名称:RenewPass,代码行数:12,代码来源:MaterialCompoundButton.java

示例3: end

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void end() {
    if (canAnimate()) {
        clearAnimation();
    }
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.play(ObjectAnimator.ofFloat(this, "scaleX", 0.85f));
    animatorSet.play(ObjectAnimator.ofFloat(this, "scaleY", 0.85f));
    animatorSet.setInterpolator(new OvershootInterpolator());
    animatorSet.setDuration(getDuration());
    animatorSet.start();
}
 
开发者ID:Coffeeboys,项目名称:RenewPass,代码行数:12,代码来源:MaterialCompoundButton.java

示例4: start

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void start() {
    if(canAnimate()){
        clearAnimation();
    }
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.play(ObjectAnimator.ofFloat(this, "scaleX", 1.0f));
    animatorSet.play(ObjectAnimator.ofFloat(this, "scaleY", 1.0f));
    animatorSet.setInterpolator(new OvershootInterpolator());
    animatorSet.setDuration(getDuration());
    animatorSet.start();
}
 
开发者ID:amphiaraus,项目名称:MaterialRadioGroup,代码行数:12,代码来源:MaterialCompoundButton.java

示例5: end

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void end() {
    if(canAnimate()){
        clearAnimation();
    }
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.play(ObjectAnimator.ofFloat(this, "scaleX", 0.85f));
    animatorSet.play(ObjectAnimator.ofFloat(this, "scaleY", 0.85f));
    animatorSet.setInterpolator(new OvershootInterpolator());
    animatorSet.setDuration(getDuration());
    animatorSet.start();
}
 
开发者ID:amphiaraus,项目名称:MaterialRadioGroup,代码行数:12,代码来源:MaterialCompoundButton.java

示例6: startRipple

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void startRipple(final Runnable animationEndRunnable) {
    if (eventCancelled) return;

    float endRadius = getEndRadius();

    cancelAnimations();

    rippleAnimator = new AnimatorSet();
    rippleAnimator.addListener(new AnimatorListenerAdapter() {
        @Override public void onAnimationEnd(Animator animation) {
            if (!ripplePersistent) {
                setRadius(0);
                setRippleAlpha(rippleAlpha);
            }
            if (animationEndRunnable != null && rippleDelayClick) {
                animationEndRunnable.run();
            }
            childView.setPressed(false);
        }
    });

    ObjectAnimator ripple = ObjectAnimator.ofFloat(this, radiusProperty, radius, endRadius);
    ripple.setDuration(rippleDuration);
    ripple.setInterpolator(new DecelerateInterpolator());
    ObjectAnimator fade = ObjectAnimator.ofInt(this, circleAlphaProperty, rippleAlpha, 0);
    fade.setDuration(rippleFadeDuration);
    fade.setInterpolator(new AccelerateInterpolator());
    fade.setStartDelay(rippleDuration - rippleFadeDuration - FADE_EXTRA_DELAY);

    if (ripplePersistent) {
        rippleAnimator.play(ripple);
    } else if (getRadius() > endRadius) {
        fade.setStartDelay(0);
        rippleAnimator.play(fade);
    } else {
        rippleAnimator.playTogether(ripple, fade);
    }
    rippleAnimator.start();
}
 
开发者ID:XinyueZ,项目名称:marsTemp,代码行数:40,代码来源:MaterialRippleLayout.java

示例7: startRipple

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void startRipple(final Runnable animationEndRunnable) {
    if (eventCancelled) return;

    float endRadius = getEndRadius();

    cancelAnimations();

    rippleAnimator = new AnimatorSet();
    rippleAnimator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            if (!ripplePersistent) {
                setRadius(0);
                setRippleAlpha(rippleAlpha);
            }
            if (animationEndRunnable != null && rippleDelayClick) {
                animationEndRunnable.run();
            }
            childView.setPressed(false);
        }
    });

    ObjectAnimator ripple = ObjectAnimator.ofFloat(this, radiusProperty, radius, endRadius);
    ripple.setDuration(rippleDuration);
    ripple.setInterpolator(new DecelerateInterpolator());
    ObjectAnimator fade = ObjectAnimator.ofInt(this, circleAlphaProperty, rippleAlpha, 0);
    fade.setDuration(rippleFadeDuration);
    fade.setInterpolator(new AccelerateInterpolator());
    fade.setStartDelay(rippleDuration - rippleFadeDuration - FADE_EXTRA_DELAY);

    if (ripplePersistent) {
        rippleAnimator.play(ripple);
    } else if (getRadius() > endRadius) {
        fade.setStartDelay(0);
        rippleAnimator.play(fade);
    } else {
        rippleAnimator.playTogether(ripple, fade);
    }
    rippleAnimator.start();
}
 
开发者ID:jinmiao,项目名称:appcutt,代码行数:41,代码来源:MaterialRippleLayout.java

示例8: setupAnimation

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
@Override
public void setupAnimation(@NonNull TransitionControllerManager manager) {
    if (mView == null) {
        mView = manager.getTarget();
    }

    if (mDelayed != null) {
        for (int i = 0, size = mDelayed.size(); i < size; i++) {
            mDelayed.get(i).evaluate(manager.getTarget(), this);
        }
    }

    for (int i = 0, size = mSetupList.size(); i < size; i++) {
        mSetupList.get(i).setupAnimation(manager);
    }

    if (mCustomTransitionController != null) {
        mCustomTransitionController.setTarget(manager.getTarget());
        mCustomTransitionController.setRange(mStart, mEnd);
        manager.addTransitionController(mCustomTransitionController.clone());
    }

    ObjectAnimator anim = new ObjectAnimator();
    anim.setTarget(mView);
    anim.setValues(getValuesHolders());
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.play(anim);
    animatorSet.setDuration(SCALE_FACTOR);
    manager.addAnimatorSetAsTransition(mView, animatorSet).setRange(mStart, mEnd);
}
 
开发者ID:kaichunlin,项目名称:android-transition,代码行数:31,代码来源:ViewTransitionBuilder.java

示例9: startRipple

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void startRipple( final Runnable animationEndRunnable ) {
	if( eventCancelled ) {
		return;
	}

	float endRadius = getEndRadius();

	cancelAnimations();

	rippleAnimator = new AnimatorSet();
	rippleAnimator.addListener( new AnimatorListenerAdapter() {
		@Override
		public void onAnimationEnd( Animator animation ) {
			if( !ripplePersistent ) {
				setRadius( 0 );
				setRippleAlpha( rippleAlpha );
			}
			if( animationEndRunnable != null && rippleDelayClick ) {
				animationEndRunnable.run();
			}
			childView.setPressed( false );
		}
	} );

	ObjectAnimator ripple = ObjectAnimator.ofFloat( this, radiusProperty, radius, endRadius );
	ripple.setDuration( rippleDuration );
	ripple.setInterpolator( new DecelerateInterpolator() );
	ObjectAnimator fade = ObjectAnimator.ofInt( this, circleAlphaProperty, rippleAlpha, 0 );
	fade.setDuration( rippleFadeDuration );
	fade.setInterpolator( new AccelerateInterpolator() );
	fade.setStartDelay( rippleDuration - rippleFadeDuration - FADE_EXTRA_DELAY );

	if( ripplePersistent ) {
		rippleAnimator.play( ripple );
	} else if( getRadius() > endRadius ) {
		fade.setStartDelay( 0 );
		rippleAnimator.play( fade );
	} else {
		rippleAnimator.playTogether( ripple, fade );
	}
	rippleAnimator.start();
}
 
开发者ID:XinyueZ,项目名称:cusnews,代码行数:43,代码来源:MaterialRippleLayout.java

示例10: addAnimatorAsTransition

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
/**
 * Adds an Animator as {@link TransitionController}
 *
 * @param mAnim
 * @return
 */
public TransitionController addAnimatorAsTransition(@NonNull Animator mAnim) {
    AnimatorSet as = new AnimatorSet();
    as.play(mAnim);
    return addAnimatorSetAsTransition(null, as);
}
 
开发者ID:kaichunlin,项目名称:android-transition,代码行数:12,代码来源:TransitionControllerManager.java

示例11: wrapAnimator

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
/**
 * Wraps an Animator as a DefaultTransitionController
 *
 * @param anim
 * @return
 */
public static DefaultTransitionController wrapAnimator(@NonNull Animator anim) {
    AnimatorSet set = new AnimatorSet();
    set.play(anim);
    return new DefaultTransitionController(set);
}
 
开发者ID:kaichunlin,项目名称:android-transition,代码行数:12,代码来源:DefaultTransitionController.java


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