本文整理匯總了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();
}