當前位置: 首頁>>代碼示例>>Java>>正文


Java AnimatorSet.setStartDelay方法代碼示例

本文整理匯總了Java中android.animation.AnimatorSet.setStartDelay方法的典型用法代碼示例。如果您正苦於以下問題:Java AnimatorSet.setStartDelay方法的具體用法?Java AnimatorSet.setStartDelay怎麽用?Java AnimatorSet.setStartDelay使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.animation.AnimatorSet的用法示例。


在下文中一共展示了AnimatorSet.setStartDelay方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onBind

import android.animation.AnimatorSet; //導入方法依賴的package包/類
@Override
public void onBind(Target view, Value o, final OnBindListener onBindListener) {
    ObjectAnimator animatorX = ObjectAnimator.ofFloat(view, View.ROTATION, 0f, 10f);
    ObjectAnimator animatorY = ObjectAnimator.ofFloat(view, View.ROTATION_X, 0f, 90f);
    AnimatorSet set = new AnimatorSet();
    set.setInterpolator(new AccelerateInterpolator(2f));
    set.setDuration(300);
    set.setStartDelay(80 * count);
    set.playTogether(animatorX, animatorY);
    set.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            onBindListener.onBindDone();
        }
    });
    set.start();
    count++;
}
 
開發者ID:sedstrom,項目名稱:Witch-Android,代碼行數:20,代碼來源:FlipOut.java

示例2: getItemsRemovedAnimation

import android.animation.AnimatorSet; //導入方法依賴的package包/類
/**
 * The animation to run on the items being removed
 * 
 * @param removed
 *            An ArrayList of <code>FreeFlowItems</code> removed
 * @return The AnimatorSet of the removed objects
 */
protected AnimatorSet getItemsRemovedAnimation(List<FreeFlowItem> removed) {
	AnimatorSet disappearingSet = new AnimatorSet();
	ArrayList<Animator> fades = new ArrayList<Animator>();
	for (FreeFlowItem proxy : removed) {
		fades.add(ObjectAnimator.ofFloat(proxy.view, "alpha", 0));
	}
	disappearingSet.setDuration(oldCellsRemovalAnimationDuration);
	disappearingSet.setStartDelay(oldCellsRemovalAnimationStartDelay);

	if (animateIndividualCellsSequentially)
		disappearingSet.playSequentially(fades);
	else
		disappearingSet.playTogether(fades);

	return disappearingSet;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:24,代碼來源:DefaultLayoutAnimator.java

示例3: getItemsAddedAnimation

import android.animation.AnimatorSet; //導入方法依賴的package包/類
/**
 * 
 */
protected AnimatorSet getItemsAddedAnimation(List<FreeFlowItem> added) {
	AnimatorSet appearingSet = new AnimatorSet();
	ArrayList<Animator> fadeIns = new ArrayList<Animator>();
	for (FreeFlowItem proxy : added) {
		proxy.view.setAlpha(0);
		fadeIns.add(ObjectAnimator.ofFloat(proxy.view, "alpha", 1));
	}

	if (animateIndividualCellsSequentially)
		appearingSet.playSequentially(fadeIns);
	else
		appearingSet.playTogether(fadeIns);

	appearingSet.setStartDelay(newCellsAdditionAnimationStartDelay);
	appearingSet.setDuration(newCellsAdditionAnimationDurationPerCell);
	return appearingSet;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:21,代碼來源:DefaultLayoutAnimator.java

示例4: animateView

import android.animation.AnimatorSet; //導入方法依賴的package包/類
/**
 * Animates given View.
 *
 * @param view the View that should be animated.
 */
private void animateView(final int position, @NonNull final View view, @NonNull final Animator[] animators) {
    if (mAnimationStartMillis == -1) {
        mAnimationStartMillis = SystemClock.uptimeMillis();
    }

    ViewCompat.setAlpha(view, 0);

    AnimatorSet set = new AnimatorSet();
    set.playTogether(animators);
    set.setStartDelay(calculateAnimationDelay(position));
    set.setDuration(mAnimationDurationMillis);
    set.start();

    mAnimators.put(view.hashCode(), set);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:21,代碼來源:ViewAnimator.java

示例5: doStart

import android.animation.AnimatorSet; //導入方法依賴的package包/類
private void doStart(long delay) {
    ObjectAnimator topMaskAnimator = ObjectAnimator.ofFloat(topMaskView, "translationY", topMaskView.getTranslationY(), -halfHitBlockHeight);
    ObjectAnimator bottomMaskAnimator = ObjectAnimator.ofFloat(bottomMaskView, "translationY", bottomMaskView.getTranslationY(), halfHitBlockHeight);
    ObjectAnimator maskShadowAnimator = ObjectAnimator.ofFloat(maskReLayout, "alpha", maskReLayout.getAlpha(), 0);

    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.play(topMaskAnimator).with(bottomMaskAnimator).with(maskShadowAnimator);
    animatorSet.setDuration(800);
    animatorSet.setStartDelay(delay);
    animatorSet.start();

    animatorSet.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            topMaskView.setVisibility(View.GONE);
            bottomMaskView.setVisibility(View.GONE);
            maskReLayout.setVisibility(View.GONE);
            onGameStart();
        }
    });
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:22,代碼來源:FunGameHeader.java

示例6: animateMenuItemOpen

import android.animation.AnimatorSet; //導入方法依賴的package包/類
void animateMenuItemOpen(View view,long delay){
    ObjectAnimator animScaleX = ObjectAnimator.ofFloat(view,"scaleX",0.0f,1.0f);
    ObjectAnimator animScaleY = ObjectAnimator.ofFloat(view,"scaleY",0.0f,1.0f);
    ObjectAnimator animAlpha = ObjectAnimator.ofFloat(view,"alpha",0,ITEM_FINAL_ALPHA);
    ObjectAnimator animRotation = ObjectAnimator.ofFloat(view,"rotation",0,360.0f);

    final int X_SCALE_ANIMATION_DURATION = 300;
    final int Y_SCALE_ANIMATION_DURATION = 300;

    animScaleX.setDuration(X_SCALE_ANIMATION_DURATION);
    animScaleY.setDuration(Y_SCALE_ANIMATION_DURATION);

    animRotation.setDuration(200);

    AnimatorSet animSet = new AnimatorSet();
    if(allowItemRotationAnim)
        animSet.playTogether(animScaleX,animScaleY,animAlpha,animRotation);
    else
        animSet.playTogether(animScaleX,animScaleY,animAlpha);
    animSet.setStartDelay(delay);
    animSet.setInterpolator(new AccelerateDecelerateInterpolator());
    animSet.start();
}
 
開發者ID:Modeso,項目名稱:ModesoActionOverlay-Android,代碼行數:24,代碼來源:ProfileAnimatedMenu.java

示例7: animateMenuItemClose

import android.animation.AnimatorSet; //導入方法依賴的package包/類
/**
 * Animates the passed view as following :scale downed to 0 ,
 * reduced alpha to 0 and a 360 degree rotation if allowed
 * @param view the view to animate
 * @param delay delay before starting the animation
 */
void animateMenuItemClose(View view,long delay){
    ObjectAnimator animScaleX = ObjectAnimator.ofFloat(view,"scaleX",1.0f,0.2f);
    ObjectAnimator animScaleY = ObjectAnimator.ofFloat(view,"scaleY",1.0f,0.2f);
    ObjectAnimator animAlpha = ObjectAnimator.ofFloat(view,"alpha",ITEM_FINAL_ALPHA,0.0f);
    ObjectAnimator animRotation = ObjectAnimator.ofFloat(view,"rotation",360.0f,0);

    final int X_SCALE_ANIMATION_DURATION = 400;
    final int Y_SCALE_ANIMATION_DURATION = 400;
    final int ALPHA_ANIMATION_DURATION = 300;

    animScaleX.setDuration(X_SCALE_ANIMATION_DURATION);
    animScaleY.setDuration(Y_SCALE_ANIMATION_DURATION);
    animAlpha.setDuration(ALPHA_ANIMATION_DURATION);

    animRotation.setDuration(500);

    AnimatorSet animSet = new AnimatorSet();
    if(allowItemRotationAnim)
        animSet.playTogether(animScaleX,animScaleY,animAlpha,animRotation);
    else
        animSet.playTogether(animScaleX,animScaleY,animAlpha);
    animSet.setInterpolator(new OvershootInterpolator(2));
    animSet.setStartDelay(delay);
    animSet.start();
}
 
開發者ID:Modeso,項目名稱:ModesoActionOverlay-Android,代碼行數:32,代碼來源:ProfileAnimatedMenu.java

示例8: setRipple

import android.animation.AnimatorSet; //導入方法依賴的package包/類
public void setRipple(boolean b) {
	rippleSet = b;
	if(height > width){
		supportPixle = height;
	}else{
		supportPixle = width;
	}
	if(rippleSet){
		Set = new AnimatorSet();
		Set.setStartDelay(0);
	}else{
		if(Set != null) {
			Set.cancel();
			Set.setStartDelay(0);
			Set = null;
		}
	}
}
 
開發者ID:KishanV,項目名稱:Android-Music-Player,代碼行數:19,代碼來源:FMView.java

示例9: setRipple

import android.animation.AnimatorSet; //導入方法依賴的package包/類
public void setRipple(boolean b) {
	rippleSet = b;
	if(height > width){
		supportPixle = height;
	}else{
		supportPixle = width;
	}
	if(rippleSet){
		Set = new AnimatorSet();
		Set.setStartDelay(0);
		mBitmapPaint = new Paint();
		mBitmapPaint.setAntiAlias(true);
		mBitmapPaint.setColor(0xFFFFFFFF);
	}else{
		if(Set != null) {
			Set.cancel();
			Set.setStartDelay(0);
			Set = null;
		}
		mBitmapPaint = null;
	}
}
 
開發者ID:KishanV,項目名稱:Android-Music-Player,代碼行數:23,代碼來源:FMlyt.java

示例10: setHighlighted

import android.animation.AnimatorSet; //導入方法依賴的package包/類
private void setHighlighted(boolean value) {
    AnimatorSet animatorSet = new AnimatorSet();
    if (value) {
        animatorSet.playTogether(
                ObjectAnimator.ofFloat(this, "scaleX", 1.06f),
                ObjectAnimator.ofFloat(this, "scaleY", 1.06f));
    } else {
        animatorSet.playTogether(
                ObjectAnimator.ofFloat(this, "scaleX", 1.0f),
                ObjectAnimator.ofFloat(this, "scaleY", 1.0f));
        animatorSet.setStartDelay(40);
    }
    animatorSet.setDuration(120);
    animatorSet.setInterpolator(interpolator);
    animatorSet.start();
}
 
開發者ID:pooyafaroka,項目名稱:PlusGram,代碼行數:17,代碼來源:ShutterButton.java

示例11: getAddAnimator

import android.animation.AnimatorSet; //導入方法依賴的package包/類
protected Animator getAddAnimator(View view, int top, int position, int addOccurTop, int addOccurPosition) {
    view.setAlpha(0);
    view.clearAnimation();
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.play(alphaObjectAnimator(view, true, 50, false));
    if (addOccurTop != top) {
        animatorSet.play(getOffsetAnimator(view, addOccurTop, top));
    }
    animatorSet.setStartDelay((long) (view.getHeight() * mOffsetDurationUnit));
    return animatorSet;
}
 
開發者ID:QMUI,項目名稱:QMUI_Android,代碼行數:12,代碼來源:QMUIAnimationListView.java

示例12: setStartDelay

import android.animation.AnimatorSet; //導入方法依賴的package包/類
/**
 * 啟動延時
 *
 * @param delay
 * @return
 */
public UDAnimatorSet setStartDelay(long delay) {
    final AnimatorSet animator = getAnimatorSet();
    if (animator != null && delay >= 0) {
        animator.setStartDelay(delay);
    }
    return this;
}
 
開發者ID:alibaba,項目名稱:LuaViewPlayground,代碼行數:14,代碼來源:UDAnimatorSet.java

示例13: fireAnimation

import android.animation.AnimatorSet; //導入方法依賴的package包/類
@Override
public void fireAnimation() {
    float offsetX=parent.getWidth()-(parent.getWidth()-first.getLeft()+getResources().getDimension(R.dimen.option_size));
    ObjectAnimator firstAnimator=ObjectAnimator.ofFloat(first,View.TRANSLATION_X,0);
    ObjectAnimator secondAnimator=ObjectAnimator.ofFloat(second,View.TRANSLATION_X,0);
    ObjectAnimator lastAnimator=ObjectAnimator.ofFloat(last,View.TRANSLATION_X,0);
    ObjectAnimator buttonAnimator=ObjectAnimator.ofFloat(controller,View.TRANSLATION_X,controller.getTranslationX());

    first.setTranslationX(-offsetX);
    second.setTranslationX(-offsetX);
    last.setTranslationX(-offsetX);
    controller.setTranslationX(-controller.getWidth());

    buttonAnimator.setInterpolator(new BounceOvershootInterpolator(4));
    AnimatorSet buttonSet=new AnimatorSet();
    buttonSet.playTogether(firstAnimator,secondAnimator,lastAnimator);
    buttonSet.setInterpolator(new BounceOvershootInterpolator(2));

    AnimatorSet animatorSet=new AnimatorSet();
    animatorSet.setStartDelay(500);
    animatorSet.playTogether(buttonSet,buttonAnimator);
    animatorSet.start();
}
 
開發者ID:vpaliyX,項目名稱:LoginConcept,代碼行數:24,代碼來源:SignUpFragment.java

示例14: animateView

import android.animation.AnimatorSet; //導入方法依賴的package包/類
/**
	 * Performs checks to scroll animate the itemView and in case, it animates the view.
	 * <p><b>Note:</b> If you have to change at runtime the LayoutManager <i>and</i> add
	 * Scrollable Headers too, consider to add them in post, using a {@code delay >= 0},
	 * otherwise scroll animations on all items will not start correctly.</p>
	 *
	 * @param holder   the ViewHolder just bound
	 * @param position the current item position
	 */
	@SuppressWarnings("ConstantConditions")
	protected final void animateView(final RecyclerView.ViewHolder holder, final int position) {
		if (mRecyclerView == null) return;

		// Use always the max child count reached
		if (mMaxChildViews < mRecyclerView.getChildCount()) {
			mMaxChildViews = mRecyclerView.getChildCount();
		}
		// Animate only during initial loading?
		if (onlyEntryAnimation && mLastAnimatedPosition >= mMaxChildViews) {
			shouldAnimate = false;
		}
		int lastVisiblePosition = Utils.findLastVisibleItemPosition(mRecyclerView.getLayoutManager());
//		if (DEBUG) {
//			Log.v(TAG, "shouldAnimate=" + shouldAnimate
//					+ " isFastScroll=" + isFastScroll
//					+ " isNotified=" + mAnimatorNotifierObserver.isPositionNotified()
//					+ " isReverseEnabled=" + isReverseEnabled
//					+ " mLastAnimatedPosition=" + mLastAnimatedPosition
//					+ (!isReverseEnabled ? " Pos>LasVisPos=" + (position > lastVisiblePosition) : "")
//					+ " mMaxChildViews=" + mMaxChildViews
//			);
//		}
		if (holder instanceof FlexibleViewHolder && shouldAnimate && !isFastScroll &&
				!mAnimatorNotifierObserver.isPositionNotified() &&
				(position > lastVisiblePosition || isReverseEnabled || isScrollableHeaderOrFooter(position) || (position == 0 && mMaxChildViews == 0))) {

			// Cancel animation is necessary when fling
			int hashCode = holder.itemView.hashCode();
			cancelExistingAnimation(hashCode);

			// User animators
			List<Animator> animators = new ArrayList<>();
			FlexibleViewHolder flexibleViewHolder = (FlexibleViewHolder) holder;
			flexibleViewHolder.scrollAnimators(animators, position, position >= lastVisiblePosition);

			// Execute the animations together
			AnimatorSet set = new AnimatorSet();
			set.playTogether(animators);
			set.setInterpolator(mInterpolator);
			// Single view duration
			long duration = mDuration;
			for (Animator animator : animators) {
				if (animator.getDuration() != DEFAULT_DURATION) {
					duration = animator.getDuration();
				}
			}
			//Log.v(TAG, "duration=" + duration);
			set.setDuration(duration);
			set.addListener(new HelperAnimatorListener(hashCode));
			if (mEntryStep) {
				// Stop stepDelay when screen is filled
				set.setStartDelay(calculateAnimationDelay(position));
			}
			set.start();
			mAnimators.put(hashCode, set);
			if (DEBUG) Log.v(TAG, "animateView    Scroll animation on position " + position);
		}
		mAnimatorNotifierObserver.clearNotified();
		// Update last animated position
		mLastAnimatedPosition = position;
	}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:72,代碼來源:AnimatorAdapter.java

示例15: animate

import android.animation.AnimatorSet; //導入方法依賴的package包/類
/**
     * Animates all dots in sequential order.
     */
    @RequiresApi(api = Build.VERSION_CODES.HONEYCOMB)
    public void animate() {
        int startDelay = 0;

        mAnimSet = new AnimatorSet();

        for (int i = 0; i < mImageViewList.size(); i++) {
            ImageView dot = mImageViewList.get(i);
//            ValueAnimator bounce = ObjectAnimator.ofFloat(dot, "y", mAnimMagnitude);
            ValueAnimator fadeIn = ObjectAnimator.ofFloat(dot, "alpha", 1f, 0.5f);
            ValueAnimator scaleX = ObjectAnimator.ofFloat(dot, "scaleX", 1f, 0.7f);
            ValueAnimator scaleY = ObjectAnimator.ofFloat(dot, "scaleY", 1f, 0.7f);

            fadeIn.setDuration(mAnimDuration);
            fadeIn.setInterpolator(new AccelerateDecelerateInterpolator());
            fadeIn.setRepeatMode(ValueAnimator.REVERSE);
            fadeIn.setRepeatCount(ValueAnimator.INFINITE);

            scaleX.setDuration(mAnimDuration);
            scaleX.setInterpolator(new AccelerateDecelerateInterpolator());
            scaleX.setRepeatMode(ValueAnimator.REVERSE);
            scaleX.setRepeatCount(ValueAnimator.INFINITE);

            scaleY.setDuration(mAnimDuration);
            scaleY.setInterpolator(new AccelerateDecelerateInterpolator());
            scaleY.setRepeatMode(ValueAnimator.REVERSE);
            scaleY.setRepeatCount(ValueAnimator.INFINITE);

//            bounce.setDuration(mAnimDuration);
//            bounce.setInterpolator(new AccelerateDecelerateInterpolator());
//            bounce.setRepeatMode(ValueAnimator.REVERSE);
//            bounce.setRepeatCount(ValueAnimator.INFINITE);

//            mAnimSet.play(bounce).after(startDelay);
            mAnimSet.play(fadeIn).after(startDelay);
            mAnimSet.play(scaleX).with(fadeIn);
            mAnimSet.play(scaleY).with(fadeIn);

            mAnimSet.setStartDelay(500);

            startDelay += (mAnimDuration / (mImageViewList.size() - 1));
        }

        mAnimSet.start();
    }
 
開發者ID:narenkukreja,項目名稱:quire,代碼行數:49,代碼來源:TypingIndicator.java


注:本文中的android.animation.AnimatorSet.setStartDelay方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。