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


Java AnimatorSet.setStartDelay方法代碼示例

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


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

示例1: animateView

import com.nineoldandroids.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();
    }

    ViewHelper.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:sathishmscict,項目名稱:ListViewAnimations,代碼行數:21,代碼來源:ViewAnimator.java

示例2: animateView

import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
private void animateView(final ViewGroup parent, final View view) {
    if (mAnimationStartMillis == -1) {
        mAnimationStartMillis = System.currentTimeMillis();
    }

    ViewHelper.setAlpha(view, 0);

    Animator[] childAnimators;
    if (mDecoratedBaseAdapter instanceof AnimationAdapter) {
        childAnimators = ((AnimationAdapter) mDecoratedBaseAdapter).getAnimators(parent, view);
    } else {
        childAnimators = new Animator[0];
    }
    Animator[] animators = getAnimators(parent, view);
    Animator alphaAnimator = ObjectAnimator.ofFloat(view, ALPHA, 0, 1);

    AnimatorSet set = new AnimatorSet();
    set.playTogether(concatAnimators(childAnimators, animators, alphaAnimator));
    set.setStartDelay(calculateAnimationDelay());
    set.setDuration(getAnimationDurationMillis());
    set.start();

    mAnimators.put(view.hashCode(), set);
}
 
開發者ID:hezhubo,項目名稱:HPlayer,代碼行數:25,代碼來源:AnimationAdapter.java

示例3: animateLoad

import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
private void animateLoad() {
    ViewHelper.setTranslationY(this, 500);
    ViewHelper.setAlpha(this, 0);

    final Animator translateAnimator = ObjectAnimator.ofFloat(this, "translationY", 0);
    translateAnimator.setDuration(400);

    final Animator alphaAnimator = ObjectAnimator.ofFloat(this, "alpha", 1);
    alphaAnimator.setStartDelay(200);
    alphaAnimator.setDuration(600);

    final AnimatorSet set = new AnimatorSet();
    set.playTogether(alphaAnimator, translateAnimator);
    set.setStartDelay(400);
    TransitionsTracker.track(set);

    set.start();
}
 
開發者ID:jrconlin,項目名稱:mc_backup,代碼行數:19,代碼來源:FirstrunPager.java

示例4: 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

示例5: setOpenCloseAnimation

import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
/**
 * Creates Open / Close AnimatorSet
 */
private AnimatorSet setOpenCloseAnimation(boolean isCloseAnimation) {
    List<Animator> textAnimations = new ArrayList<>();
    List<Animator> imageAnimations = new ArrayList<>();

    if (isCloseAnimation) {
        for (int i = getItemCount() - 1; i >= 0; i--) {
            fillOpenClosingAnimations(true, textAnimations, imageAnimations, i);
        }
    } else {
        for (int i = 0; i < getItemCount(); i++) {
            fillOpenClosingAnimations(false, textAnimations, imageAnimations, i);
        }
    }

    AnimatorSet textCloseAnimatorSet = new AnimatorSet();
    textCloseAnimatorSet.playSequentially(textAnimations);

    AnimatorSet imageCloseAnimatorSet = new AnimatorSet();
    imageCloseAnimatorSet.playSequentially(imageAnimations);

    AnimatorSet animatorFullSet = new AnimatorSet();
    animatorFullSet.playTogether(imageCloseAnimatorSet, textCloseAnimatorSet);
    animatorFullSet.setDuration(mAnimationDurationMilis);
    animatorFullSet.addListener(mCloseOpenAnimatorListener);
    animatorFullSet.setStartDelay(0);
    animatorFullSet.setInterpolator(new HesitateInterpolator());
    return animatorFullSet;
}
 
開發者ID:zongkaili,項目名稱:MenuSet,代碼行數:32,代碼來源:MenuAdapter.java

示例6: animation

import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
private void animation(MenuVH menuVH) {

        ViewHelper.setAlpha(menuVH.itemView, 0);

        ViewHelper.setTranslationY(menuVH.itemView, 300);
        ObjectAnimator translationY = ObjectAnimator.ofFloat(menuVH.itemView, "translationY", 500, 0);
        translationY.setDuration(300);
        translationY.setInterpolator(new OvershootInterpolator(1.6f));
        ObjectAnimator alphaIn = ObjectAnimator.ofFloat(menuVH.itemView, "alpha", 0, 1);
        alphaIn.setDuration(100);
        AnimatorSet animatorSet = new AnimatorSet();
        animatorSet.playTogether(translationY, alphaIn);
        animatorSet.setStartDelay(30 * menuVH.getAdapterPosition());
        animatorSet.start();
    }
 
開發者ID:xiangyunwan,項目名稱:AndroidSweetSheet-master,代碼行數:16,代碼來源:MenuRVAdapter.java

示例7: animateTitles

import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
private void animateTitles() {
    final View prevTextView = getChildAt(0);
    final View nextTextView = getChildAt(getChildCount() - 1);

    if (prevTextView == null || nextTextView == null) {
        return;
    }

    // Set up initial values for the views that will be animated.
    ViewHelper.setTranslationX(prevTextView, -INIT_OFFSET);
    ViewHelper.setAlpha(prevTextView, 0);
    ViewHelper.setTranslationX(nextTextView, INIT_OFFSET);
    ViewHelper.setAlpha(nextTextView, 0);

    // Alpha animations.
    final ValueAnimator alpha1 = ObjectAnimator.ofFloat(prevTextView, "alpha", 1);
    final ValueAnimator alpha2 = ObjectAnimator.ofFloat(nextTextView, "alpha", 1);

    final AnimatorSet alphaAnimatorSet = new AnimatorSet();
    alphaAnimatorSet.playTogether(alpha1, alpha2);
    alphaAnimatorSet.setDuration(ALPHA_MS);
    alphaAnimatorSet.setStartDelay(ANIMATION_DELAY_MS);

    // Bounce animation.
    final float bounceDistance = getWidth()/100f; // Hack: TextFields still have 0 width here.

    final BounceAnimatorBuilder prevBounceAnimatorBuilder = new BounceAnimatorBuilder(prevTextView, "translationX");
    prevBounceAnimatorBuilder.queue(new Attributes(bounceDistance, BOUNCE1_MS));
    prevBounceAnimatorBuilder.queue(new Attributes(-bounceDistance/4, BOUNCE2_MS));
    prevBounceAnimatorBuilder.queue(new Attributes(0, BOUNCE3_MS));

    final BounceAnimatorBuilder nextBounceAnimatorBuilder = new BounceAnimatorBuilder(nextTextView, "translationX");
    nextBounceAnimatorBuilder.queue(new Attributes(-bounceDistance, BOUNCE1_MS));
    nextBounceAnimatorBuilder.queue(new Attributes(bounceDistance/4, BOUNCE2_MS));
    nextBounceAnimatorBuilder.queue(new Attributes(0, BOUNCE3_MS));

    final AnimatorSet bounceAnimatorSet = new AnimatorSet();
    bounceAnimatorSet.playTogether(prevBounceAnimatorBuilder.build(), nextBounceAnimatorBuilder.build());

    TransitionsTracker.track(nextBounceAnimatorBuilder);

    final AnimatorSet titlesAnimatorSet = new AnimatorSet();
    titlesAnimatorSet.playTogether(alphaAnimatorSet, bounceAnimatorSet);
    titlesAnimatorSet.setStartDelay(ANIMATION_DELAY_MS);

    // Start animations.
    titlesAnimatorSet.start();
}
 
開發者ID:jrconlin,項目名稱:mc_backup,代碼行數:49,代碼來源:HomePagerTabStrip.java


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