當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。