本文整理汇总了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;
}
示例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();
}
}
});
}
示例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();
}
}
}
示例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();
}
示例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;
}
示例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();
}
}
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
}
});
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}