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


Java AnimatorSet.playSequentially方法代码示例

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


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

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

示例2: initAnim

import android.animation.AnimatorSet; //导入方法依赖的package包/类
public void initAnim(){
    mAnimatorSet = new AnimatorSet();

    ValueAnimator flattenAnim = createFlattenAnim();

    // 等待黄色圆传递
    ValueAnimator waitForAnim = ValueAnimator.ofFloat(0, 100);
    waitForAnim.setDuration(mDuration2);
    // 黄色圆缩小,绿色弧线出现,旋转从0->-120,从-120->-240,抛出黄色小球,绿色弧线逐渐变成球,
    // 红色弧线绕圈,逐渐合并为圆环,
    ValueAnimator smallerAndRotateAnim = createSmallerAndRotateAnim();
    ValueAnimator backAnim = createBackAnim();
    mAnimatorSet.playSequentially(flattenAnim, waitForAnim, smallerAndRotateAnim, backAnim);
    mAnimatorSet.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            if(mListener != null){
                mListener.onCakeChangeAnimatorEnd();
            }
        }
    });
}
 
开发者ID:chengkun123,项目名称:ReadMark,代码行数:24,代码来源:ThirdCake.java

示例3: changeState

import android.animation.AnimatorSet; //导入方法依赖的package包/类
private void changeState(int state) {
    if (this.state == state) {
        return;
    }

    tempBitmap.recycle();
    resetTempCanvas();

    this.state = state;
    if (state == STATE_PROGRESS_STARTED) {
        setCurrentProgress(0);
        simulateProgressAnimator.start();
    } else if (state == STATE_DONE_STARTED) {
        setCurrentDoneBgOffset(MAX_DONE_BG_OFFSET);
        setCurrentCheckmarkOffset(MAX_DONE_IMG_OFFSET);
        AnimatorSet animatorSet = new AnimatorSet();
        animatorSet.playSequentially(doneBgAnimator, checkmarkAnimator);
        animatorSet.start();
    } else if (state == STATE_FINISHED) {
        if (onLoadingFinishedListener != null) {
            onLoadingFinishedListener.onLoadingFinished();
        }
    }
}
 
开发者ID:NarendraSickarwar,项目名称:FirebasePost,代码行数:25,代码来源:SendingProgressView.java

示例4: animateShutter

import android.animation.AnimatorSet; //导入方法依赖的package包/类
private void animateShutter() {
  vShutter.setVisibility(View.VISIBLE);
  vShutter.setAlpha(0.f);

  ObjectAnimator alphaInAnim = ObjectAnimator.ofFloat(vShutter, "alpha", 0f, 0.8f);
  alphaInAnim.setDuration(100);
  alphaInAnim.setStartDelay(100);
  alphaInAnim.setInterpolator(ACCELERATE_INTERPOLATOR);

  ObjectAnimator alphaOutAnim = ObjectAnimator.ofFloat(vShutter, "alpha", 0.8f, 0f);
  alphaOutAnim.setDuration(200);
  alphaOutAnim.setInterpolator(DECELERATE_INTERPOLATOR);

  AnimatorSet animatorSet = new AnimatorSet();
  animatorSet.playSequentially(alphaInAnim, alphaOutAnim);
  animatorSet.addListener(new AnimatorListenerAdapter() {
    @Override
    public void onAnimationEnd(Animator animation) {
      vShutter.setVisibility(View.GONE);
    }
  });
  animatorSet.start();
}
 
开发者ID:softonic,项目名称:instamaterial,代码行数:24,代码来源:TakePhotoActivity.java

示例5: runTestChangeAnimation

import android.animation.AnimatorSet; //导入方法依赖的package包/类
/**
 * Procedure meant to execute a change animation for the desired {@link RecyclerView.ViewHolder}.
 * @param holder the {@link RecyclerView} item's {@link RecyclerView.ViewHolder}.
 * @param itemView the {@link RecyclerView.ViewHolder}'s root view.
 * @param listener the {@link GenericItemAnimator} instance orchestrating the animations.
 * @return the resulting {@link AnimatorSet} for the {@link RecyclerView} item's {@link RecyclerView.ViewHolder}.
 */
public static AnimatorSet runTestChangeAnimation(@NonNull final RecyclerView.ViewHolder holder,
                                          @NonNull final View itemView,
                                          @NonNull final GenericItemAnimator listener) {
    final ObjectAnimator oldTextRotate = ObjectAnimator.ofFloat(itemView, View.ROTATION_X, 0, 90);
    final ObjectAnimator newTextRotate = ObjectAnimator.ofFloat(itemView, View.ROTATION_X, -90, 0);
    final AnimatorSet textAnim = new AnimatorSet();

    textAnim.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(@NonNull final Animator animation) {
            listener.onAnimationFinished(holder, CHANGE_ANIMATION_FINISHED);
        }
    });

    textAnim.playSequentially(oldTextRotate, newTextRotate);
    return textAnim;
}
 
开发者ID:Simdea,项目名称:gmlrva,代码行数:25,代码来源:ViewHolderAnimationHelper.java

示例6: changeState

import android.animation.AnimatorSet; //导入方法依赖的package包/类
private void changeState(int state) {
  if (this.state == state) {
    return;
  }

  tempBitmap.recycle();
  resetTempCanvas();

  this.state = state;
  if (state == STATE_PROGRESS_STARTED) {
    setCurrentProgress(0);
    simulateProgressAnimator.start();
  } else if (state == STATE_DONE_STARTED) {
    setCurrentDoneBgOffset(MAX_DONE_BG_OFFSET);
    setCurrentCheckmarkOffset(MAX_DONE_IMG_OFFSET);
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.playSequentially(doneBgAnimator, checkmarkAnimator);
    animatorSet.start();
  } else if (state == STATE_FINISHED) {
    if (onLoadingFinishedListener != null) {
      onLoadingFinishedListener.onLoadingFinished();
    }
  }
}
 
开发者ID:softonic,项目名称:instamaterial,代码行数:25,代码来源:SendingProgressView.java

示例7: animateShutter

import android.animation.AnimatorSet; //导入方法依赖的package包/类
private void animateShutter() {
    vShutter.setVisibility(View.VISIBLE);
    vShutter.setAlpha(0.f);

    ObjectAnimator alphaInAnim = ObjectAnimator.ofFloat(vShutter, "alpha", 0f, 0.8f);
    alphaInAnim.setDuration(100);
    alphaInAnim.setStartDelay(100);
    alphaInAnim.setInterpolator(ACCELERATE_INTERPOLATOR);

    ObjectAnimator alphaOutAnim = ObjectAnimator.ofFloat(vShutter, "alpha", 0.8f, 0f);
    alphaOutAnim.setDuration(200);
    alphaOutAnim.setInterpolator(DECELERATE_INTERPOLATOR);

    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.playSequentially(alphaInAnim, alphaOutAnim);
    animatorSet.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            vShutter.setVisibility(View.GONE);
        }
    });
    animatorSet.start();
}
 
开发者ID:NarendraSickarwar,项目名称:FirebasePost,代码行数:24,代码来源:TakePhotoActivity.java

示例8: getAnimator

import android.animation.AnimatorSet; //导入方法依赖的package包/类
private Animator getAnimator(LeafHolder target, RectF leafFlyRect, float progress) {
    ValueAnimator bezierValueAnimator = getBezierValueAnimator(target, leafFlyRect, progress);

    AnimatorSet finalSet = new AnimatorSet();
    finalSet.playSequentially(bezierValueAnimator);
    finalSet.setInterpolator(INTERPOLATORS[mRandom.nextInt(INTERPOLATORS.length)]);
    finalSet.setTarget(target);
    return finalSet;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:ElectricFanLoadingRenderer.java

示例9: showFooter

import android.animation.AnimatorSet; //导入方法依赖的package包/类
/**
 * Function to show footer
 */
public void showFooter() {
    DisplayMetrics metrics = getResources().getDisplayMetrics();
    screenHeight = metrics.heightPixels;
    ObjectAnimator animY = ObjectAnimator.ofFloat(footerContainer, "y", screenHeight
            - footerContainer.getHeight());
    AnimatorSet animSetXY = new AnimatorSet();
    animSetXY.setInterpolator(new LinearInterpolator());
    animSetXY.playSequentially(animY);
    animSetXY.start();
}
 
开发者ID:fekracomputers,项目名称:QuranAndroid,代码行数:14,代码来源:QuranPageReadActivity.java

示例10: hideFooter

import android.animation.AnimatorSet; //导入方法依赖的package包/类
/**
 * Function to hide footer
 */
public void hideFooter() {
    DisplayMetrics metrics = getResources().getDisplayMetrics();
    screenHeight = metrics.heightPixels;
    ObjectAnimator animY = ObjectAnimator.ofFloat(footerContainer, "y", screenHeight
            + footerContainer.getHeight());
    AnimatorSet animSetXY = new AnimatorSet();
    animSetXY.setInterpolator(new LinearInterpolator());
    animSetXY.playSequentially(animY);
    animSetXY.start();
}
 
开发者ID:fekracomputers,项目名称:QuranAndroid,代码行数:14,代码来源:QuranPageReadActivity.java

示例11: initAnim

import android.animation.AnimatorSet; //导入方法依赖的package包/类
@Override
protected void initAnim() {
    mAnimatorSet = new AnimatorSet();
    // 黄色圆环,内部绿色小球由无变大到圆环,仍然在黄色圆弧内
    ValueAnimator anim1 = createInsideCircleAnim();
    // 黄色圆环旋转为圆弧,带有一点蓝色的尾巴,逐渐缩短,绿色圆膨胀一些,变为圆环
    ValueAnimator anim2 = createRotateAnim();
    // 等待小球的到来,黄色圆弧彻底消失,绿色圆弧变为实心圆
    ValueAnimator anim3 = createWaitAndFillAnim();
    // 填充,等待一会,缩小然后放大
    ValueAnimator anim4 = createSmallBiggerAnim();
    // 圆环颜色由内向外拓展为蓝色.颜色由浅逐渐变深,一半的时候,内拓为红色,再到黄色,最后全黄,回到第一步
    ValueAnimator anim5 = createColorfulAnim();

    ValueAnimator anim6 = createPassAnim();

    mAnimatorSet.playSequentially(anim1, anim2, anim3, anim4, anim5, anim6
    );
    mAnimatorSet.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            STANDARD_MIN_R = 15;
            mFiCurR = MAX_RADIUS_CIRCLE;
            mFiStrokeWidth = 33;
            mSeCurR = 0;
            mSeStrokeWidth = mSeCurR;
            if(mListener != null){
                mListener.onCakeChangeAnimatorEnd();
            }
        }
    });
}
 
开发者ID:chengkun123,项目名称:ReadMark,代码行数:33,代码来源:ForthCake.java

示例12: getAnimtor

import android.animation.AnimatorSet; //导入方法依赖的package包/类
/**
 * 爱心的显示和运行轨迹动画组合实现
 */
private Animator getAnimtor(View target) {

  AnimatorSet enterAnimtorSet = getEnterAnimtorSet(target);
  ValueAnimator bezierAnimtor = getBezierAnimtor(target);

  AnimatorSet animatorSet = new AnimatorSet();
  animatorSet.playSequentially(enterAnimtorSet);
  animatorSet.playSequentially(enterAnimtorSet, bezierAnimtor);
  animatorSet.setInterpolator(interpolators[mRandom.nextInt(4)]);
  animatorSet.setTarget(target);

  return animatorSet;
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:17,代码来源:LoveLikeLayout.java

示例13: setUpAnimator

import android.animation.AnimatorSet; //导入方法依赖的package包/类
/**
 * 根据移动类型设置不同的动画
 */
private void setUpAnimator() {
    AnimatorSet animatorSet = new AnimatorSet();
    pathDistances.clear();

    switch (movementType) {
        case HORIZONTAL_MOVE:
            animatorSet.playSequentially(createHorizontalAnimator(0, offsetWidth),
                    createHorizontalAnimator(offsetWidth, 0));
            break;
        case VERTICAL_MOVE:
            animatorSet.playSequentially(createVerticalAnimator(0, offsetHeight),
                    createVerticalAnimator(offsetHeight, 0));
            break;
        case DIAGONAL_MOVE:
            animatorSet.playSequentially(createDiagonalAnimator(0, offsetWidth, 0,
                    offsetHeight),
                    createDiagonalAnimator(offsetWidth, 0, offsetHeight, 0));
            break;
        case AUTO_MOVE:
            animatorSet.playSequentially(
                    createVerticalAnimator(0, offsetHeight),
                    createDiagonalAnimator(0, offsetWidth, offsetHeight, 0),
                    createHorizontalAnimator(offsetWidth, 0),
                    createDiagonalAnimator(0, offsetWidth, 0, offsetHeight),
                    createHorizontalAnimator(offsetWidth, 0),
                    createVerticalAnimator(offsetHeight, 0));
    }

    if (mAnimatorSet != null) {
        mAnimatorSet.removeAllListeners();
        stop();
    }
    mAnimatorSet = animatorSet;
}
 
开发者ID:Horrarndoo,项目名称:YiZhi,代码行数:38,代码来源:MovingViewAnimator.java

示例14: animateAnimatorSetSample

import android.animation.AnimatorSet; //导入方法依赖的package包/类
private void animateAnimatorSetSample(ImageView target) {

		// Set AnimatorList(Will set on AnimatorSet)
		List<Animator> animatorList= new ArrayList<Animator>();

		// alphaプロパティを0fから1fに変化させます
		PropertyValuesHolder alphaAnimator = PropertyValuesHolder.ofFloat("alpha", minAlpha ,maxAlpha, minAlpha);

		PropertyValuesHolder flipAnimator = PropertyValuesHolder.ofFloat(orientation, startAngle, endAngle);

		ObjectAnimator translationAnimator =
				ObjectAnimator.ofPropertyValuesHolder(target, alphaAnimator, flipAnimator);
		translationAnimator.setDuration(duration);
		translationAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
//		// faster
//		translationAnimator.setInterpolator(new AccelerateInterpolator());
//		// slower
//		translationAnimator.setInterpolator(new DecelerateInterpolator());
//		// fast->slow->fast
//		translationAnimator.setInterpolator(new AccelerateDecelerateInterpolator());

		// repeat translationAnimator
		translationAnimator.setRepeatCount(ObjectAnimator.INFINITE);
		// Set all animation to animatorList
		animatorList.add(translationAnimator);

		final AnimatorSet animatorSet = new AnimatorSet();
		// Set animatorList to animatorSet
		animatorSet.playSequentially(animatorList);

		// Start Animation
		animatorSet.start();
	}
 
开发者ID:Taishi-Y,项目名称:FlipProgressDialog,代码行数:34,代码来源:FlipProgressDialog.java

示例15: onButtonClick

import android.animation.AnimatorSet; //导入方法依赖的package包/类
public void onButtonClick(View view) {
    long animationDuration = (long) (BASE_DURATION * sAnimatorScale);

    // Scale around bottom/middle to simplify squash against the window bottom
    view.setPivotX(view.getWidth() / 2);
    view.setPivotY(view.getHeight());
    
    // Animate the button down, accelerating, while also stretching in Y and squashing in X
    PropertyValuesHolder pvhTY = PropertyValuesHolder.ofFloat(View.TRANSLATION_Y,
            mContainer.getHeight() - view.getHeight());
    PropertyValuesHolder pvhSX = PropertyValuesHolder.ofFloat(View.SCALE_X, .7f);
    PropertyValuesHolder pvhSY = PropertyValuesHolder.ofFloat(View.SCALE_Y, 1.2f);
    ObjectAnimator downAnim = ObjectAnimator.ofPropertyValuesHolder(
            view, pvhTY, pvhSX, pvhSY);
    downAnim.setInterpolator(sAccelerator);
    downAnim.setDuration((long) (animationDuration * 2));

    // Stretch in X, squash in Y, then reverse
    pvhSX = PropertyValuesHolder.ofFloat(View.SCALE_X, 2);
    pvhSY = PropertyValuesHolder.ofFloat(View.SCALE_Y, .5f);
    ObjectAnimator stretchAnim =
            ObjectAnimator.ofPropertyValuesHolder(view, pvhSX, pvhSY);
    stretchAnim.setRepeatCount(1);
    stretchAnim.setRepeatMode(ValueAnimator.REVERSE);
    stretchAnim.setInterpolator(sDecelerator);
    stretchAnim.setDuration(animationDuration);
    
    // Animate back to the start
    pvhTY = PropertyValuesHolder.ofFloat(View.TRANSLATION_Y, 0);
    pvhSX = PropertyValuesHolder.ofFloat(View.SCALE_X, 1);
    pvhSY = PropertyValuesHolder.ofFloat(View.SCALE_Y, 1);
    ObjectAnimator upAnim =
            ObjectAnimator.ofPropertyValuesHolder(view, pvhTY, pvhSX, pvhSY);
    upAnim.setDuration((long) (animationDuration * 2));
    upAnim.setInterpolator(sDecelerator);

    AnimatorSet set = new AnimatorSet();
    set.playSequentially(downAnim, stretchAnim, upAnim);
    set.start();
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:41,代码来源:SquashAndStretch.java


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