当前位置: 首页>>代码示例>>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;未经允许,请勿转载。