本文整理汇总了Java中android.animation.AnimatorSet.setStartDelay方法的典型用法代码示例。如果您正苦于以下问题:Java AnimatorSet.setStartDelay方法的具体用法?Java AnimatorSet.setStartDelay怎么用?Java AnimatorSet.setStartDelay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.animation.AnimatorSet
的用法示例。
在下文中一共展示了AnimatorSet.setStartDelay方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBind
import android.animation.AnimatorSet; //导入方法依赖的package包/类
@Override
public void onBind(Target view, Value o, final OnBindListener onBindListener) {
ObjectAnimator animatorX = ObjectAnimator.ofFloat(view, View.ROTATION, 0f, 10f);
ObjectAnimator animatorY = ObjectAnimator.ofFloat(view, View.ROTATION_X, 0f, 90f);
AnimatorSet set = new AnimatorSet();
set.setInterpolator(new AccelerateInterpolator(2f));
set.setDuration(300);
set.setStartDelay(80 * count);
set.playTogether(animatorX, animatorY);
set.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
onBindListener.onBindDone();
}
});
set.start();
count++;
}
示例2: 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;
}
示例3: getItemsAddedAnimation
import android.animation.AnimatorSet; //导入方法依赖的package包/类
/**
*
*/
protected AnimatorSet getItemsAddedAnimation(List<FreeFlowItem> added) {
AnimatorSet appearingSet = new AnimatorSet();
ArrayList<Animator> fadeIns = new ArrayList<Animator>();
for (FreeFlowItem proxy : added) {
proxy.view.setAlpha(0);
fadeIns.add(ObjectAnimator.ofFloat(proxy.view, "alpha", 1));
}
if (animateIndividualCellsSequentially)
appearingSet.playSequentially(fadeIns);
else
appearingSet.playTogether(fadeIns);
appearingSet.setStartDelay(newCellsAdditionAnimationStartDelay);
appearingSet.setDuration(newCellsAdditionAnimationDurationPerCell);
return appearingSet;
}
示例4: animateView
import android.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();
}
ViewCompat.setAlpha(view, 0);
AnimatorSet set = new AnimatorSet();
set.playTogether(animators);
set.setStartDelay(calculateAnimationDelay(position));
set.setDuration(mAnimationDurationMillis);
set.start();
mAnimators.put(view.hashCode(), set);
}
示例5: doStart
import android.animation.AnimatorSet; //导入方法依赖的package包/类
private void doStart(long delay) {
ObjectAnimator topMaskAnimator = ObjectAnimator.ofFloat(topMaskView, "translationY", topMaskView.getTranslationY(), -halfHitBlockHeight);
ObjectAnimator bottomMaskAnimator = ObjectAnimator.ofFloat(bottomMaskView, "translationY", bottomMaskView.getTranslationY(), halfHitBlockHeight);
ObjectAnimator maskShadowAnimator = ObjectAnimator.ofFloat(maskReLayout, "alpha", maskReLayout.getAlpha(), 0);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.play(topMaskAnimator).with(bottomMaskAnimator).with(maskShadowAnimator);
animatorSet.setDuration(800);
animatorSet.setStartDelay(delay);
animatorSet.start();
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
topMaskView.setVisibility(View.GONE);
bottomMaskView.setVisibility(View.GONE);
maskReLayout.setVisibility(View.GONE);
onGameStart();
}
});
}
示例6: animateMenuItemOpen
import android.animation.AnimatorSet; //导入方法依赖的package包/类
void animateMenuItemOpen(View view,long delay){
ObjectAnimator animScaleX = ObjectAnimator.ofFloat(view,"scaleX",0.0f,1.0f);
ObjectAnimator animScaleY = ObjectAnimator.ofFloat(view,"scaleY",0.0f,1.0f);
ObjectAnimator animAlpha = ObjectAnimator.ofFloat(view,"alpha",0,ITEM_FINAL_ALPHA);
ObjectAnimator animRotation = ObjectAnimator.ofFloat(view,"rotation",0,360.0f);
final int X_SCALE_ANIMATION_DURATION = 300;
final int Y_SCALE_ANIMATION_DURATION = 300;
animScaleX.setDuration(X_SCALE_ANIMATION_DURATION);
animScaleY.setDuration(Y_SCALE_ANIMATION_DURATION);
animRotation.setDuration(200);
AnimatorSet animSet = new AnimatorSet();
if(allowItemRotationAnim)
animSet.playTogether(animScaleX,animScaleY,animAlpha,animRotation);
else
animSet.playTogether(animScaleX,animScaleY,animAlpha);
animSet.setStartDelay(delay);
animSet.setInterpolator(new AccelerateDecelerateInterpolator());
animSet.start();
}
示例7: animateMenuItemClose
import android.animation.AnimatorSet; //导入方法依赖的package包/类
/**
* Animates the passed view as following :scale downed to 0 ,
* reduced alpha to 0 and a 360 degree rotation if allowed
* @param view the view to animate
* @param delay delay before starting the animation
*/
void animateMenuItemClose(View view,long delay){
ObjectAnimator animScaleX = ObjectAnimator.ofFloat(view,"scaleX",1.0f,0.2f);
ObjectAnimator animScaleY = ObjectAnimator.ofFloat(view,"scaleY",1.0f,0.2f);
ObjectAnimator animAlpha = ObjectAnimator.ofFloat(view,"alpha",ITEM_FINAL_ALPHA,0.0f);
ObjectAnimator animRotation = ObjectAnimator.ofFloat(view,"rotation",360.0f,0);
final int X_SCALE_ANIMATION_DURATION = 400;
final int Y_SCALE_ANIMATION_DURATION = 400;
final int ALPHA_ANIMATION_DURATION = 300;
animScaleX.setDuration(X_SCALE_ANIMATION_DURATION);
animScaleY.setDuration(Y_SCALE_ANIMATION_DURATION);
animAlpha.setDuration(ALPHA_ANIMATION_DURATION);
animRotation.setDuration(500);
AnimatorSet animSet = new AnimatorSet();
if(allowItemRotationAnim)
animSet.playTogether(animScaleX,animScaleY,animAlpha,animRotation);
else
animSet.playTogether(animScaleX,animScaleY,animAlpha);
animSet.setInterpolator(new OvershootInterpolator(2));
animSet.setStartDelay(delay);
animSet.start();
}
示例8: setRipple
import android.animation.AnimatorSet; //导入方法依赖的package包/类
public void setRipple(boolean b) {
rippleSet = b;
if(height > width){
supportPixle = height;
}else{
supportPixle = width;
}
if(rippleSet){
Set = new AnimatorSet();
Set.setStartDelay(0);
}else{
if(Set != null) {
Set.cancel();
Set.setStartDelay(0);
Set = null;
}
}
}
示例9: setRipple
import android.animation.AnimatorSet; //导入方法依赖的package包/类
public void setRipple(boolean b) {
rippleSet = b;
if(height > width){
supportPixle = height;
}else{
supportPixle = width;
}
if(rippleSet){
Set = new AnimatorSet();
Set.setStartDelay(0);
mBitmapPaint = new Paint();
mBitmapPaint.setAntiAlias(true);
mBitmapPaint.setColor(0xFFFFFFFF);
}else{
if(Set != null) {
Set.cancel();
Set.setStartDelay(0);
Set = null;
}
mBitmapPaint = null;
}
}
示例10: setHighlighted
import android.animation.AnimatorSet; //导入方法依赖的package包/类
private void setHighlighted(boolean value) {
AnimatorSet animatorSet = new AnimatorSet();
if (value) {
animatorSet.playTogether(
ObjectAnimator.ofFloat(this, "scaleX", 1.06f),
ObjectAnimator.ofFloat(this, "scaleY", 1.06f));
} else {
animatorSet.playTogether(
ObjectAnimator.ofFloat(this, "scaleX", 1.0f),
ObjectAnimator.ofFloat(this, "scaleY", 1.0f));
animatorSet.setStartDelay(40);
}
animatorSet.setDuration(120);
animatorSet.setInterpolator(interpolator);
animatorSet.start();
}
示例11: getAddAnimator
import android.animation.AnimatorSet; //导入方法依赖的package包/类
protected Animator getAddAnimator(View view, int top, int position, int addOccurTop, int addOccurPosition) {
view.setAlpha(0);
view.clearAnimation();
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.play(alphaObjectAnimator(view, true, 50, false));
if (addOccurTop != top) {
animatorSet.play(getOffsetAnimator(view, addOccurTop, top));
}
animatorSet.setStartDelay((long) (view.getHeight() * mOffsetDurationUnit));
return animatorSet;
}
示例12: setStartDelay
import android.animation.AnimatorSet; //导入方法依赖的package包/类
/**
* 启动延时
*
* @param delay
* @return
*/
public UDAnimatorSet setStartDelay(long delay) {
final AnimatorSet animator = getAnimatorSet();
if (animator != null && delay >= 0) {
animator.setStartDelay(delay);
}
return this;
}
示例13: fireAnimation
import android.animation.AnimatorSet; //导入方法依赖的package包/类
@Override
public void fireAnimation() {
float offsetX=parent.getWidth()-(parent.getWidth()-first.getLeft()+getResources().getDimension(R.dimen.option_size));
ObjectAnimator firstAnimator=ObjectAnimator.ofFloat(first,View.TRANSLATION_X,0);
ObjectAnimator secondAnimator=ObjectAnimator.ofFloat(second,View.TRANSLATION_X,0);
ObjectAnimator lastAnimator=ObjectAnimator.ofFloat(last,View.TRANSLATION_X,0);
ObjectAnimator buttonAnimator=ObjectAnimator.ofFloat(controller,View.TRANSLATION_X,controller.getTranslationX());
first.setTranslationX(-offsetX);
second.setTranslationX(-offsetX);
last.setTranslationX(-offsetX);
controller.setTranslationX(-controller.getWidth());
buttonAnimator.setInterpolator(new BounceOvershootInterpolator(4));
AnimatorSet buttonSet=new AnimatorSet();
buttonSet.playTogether(firstAnimator,secondAnimator,lastAnimator);
buttonSet.setInterpolator(new BounceOvershootInterpolator(2));
AnimatorSet animatorSet=new AnimatorSet();
animatorSet.setStartDelay(500);
animatorSet.playTogether(buttonSet,buttonAnimator);
animatorSet.start();
}
示例14: animateView
import android.animation.AnimatorSet; //导入方法依赖的package包/类
/**
* Performs checks to scroll animate the itemView and in case, it animates the view.
* <p><b>Note:</b> If you have to change at runtime the LayoutManager <i>and</i> add
* Scrollable Headers too, consider to add them in post, using a {@code delay >= 0},
* otherwise scroll animations on all items will not start correctly.</p>
*
* @param holder the ViewHolder just bound
* @param position the current item position
*/
@SuppressWarnings("ConstantConditions")
protected final void animateView(final RecyclerView.ViewHolder holder, final int position) {
if (mRecyclerView == null) return;
// Use always the max child count reached
if (mMaxChildViews < mRecyclerView.getChildCount()) {
mMaxChildViews = mRecyclerView.getChildCount();
}
// Animate only during initial loading?
if (onlyEntryAnimation && mLastAnimatedPosition >= mMaxChildViews) {
shouldAnimate = false;
}
int lastVisiblePosition = Utils.findLastVisibleItemPosition(mRecyclerView.getLayoutManager());
// if (DEBUG) {
// Log.v(TAG, "shouldAnimate=" + shouldAnimate
// + " isFastScroll=" + isFastScroll
// + " isNotified=" + mAnimatorNotifierObserver.isPositionNotified()
// + " isReverseEnabled=" + isReverseEnabled
// + " mLastAnimatedPosition=" + mLastAnimatedPosition
// + (!isReverseEnabled ? " Pos>LasVisPos=" + (position > lastVisiblePosition) : "")
// + " mMaxChildViews=" + mMaxChildViews
// );
// }
if (holder instanceof FlexibleViewHolder && shouldAnimate && !isFastScroll &&
!mAnimatorNotifierObserver.isPositionNotified() &&
(position > lastVisiblePosition || isReverseEnabled || isScrollableHeaderOrFooter(position) || (position == 0 && mMaxChildViews == 0))) {
// Cancel animation is necessary when fling
int hashCode = holder.itemView.hashCode();
cancelExistingAnimation(hashCode);
// User animators
List<Animator> animators = new ArrayList<>();
FlexibleViewHolder flexibleViewHolder = (FlexibleViewHolder) holder;
flexibleViewHolder.scrollAnimators(animators, position, position >= lastVisiblePosition);
// Execute the animations together
AnimatorSet set = new AnimatorSet();
set.playTogether(animators);
set.setInterpolator(mInterpolator);
// Single view duration
long duration = mDuration;
for (Animator animator : animators) {
if (animator.getDuration() != DEFAULT_DURATION) {
duration = animator.getDuration();
}
}
//Log.v(TAG, "duration=" + duration);
set.setDuration(duration);
set.addListener(new HelperAnimatorListener(hashCode));
if (mEntryStep) {
// Stop stepDelay when screen is filled
set.setStartDelay(calculateAnimationDelay(position));
}
set.start();
mAnimators.put(hashCode, set);
if (DEBUG) Log.v(TAG, "animateView Scroll animation on position " + position);
}
mAnimatorNotifierObserver.clearNotified();
// Update last animated position
mLastAnimatedPosition = position;
}
示例15: animate
import android.animation.AnimatorSet; //导入方法依赖的package包/类
/**
* Animates all dots in sequential order.
*/
@RequiresApi(api = Build.VERSION_CODES.HONEYCOMB)
public void animate() {
int startDelay = 0;
mAnimSet = new AnimatorSet();
for (int i = 0; i < mImageViewList.size(); i++) {
ImageView dot = mImageViewList.get(i);
// ValueAnimator bounce = ObjectAnimator.ofFloat(dot, "y", mAnimMagnitude);
ValueAnimator fadeIn = ObjectAnimator.ofFloat(dot, "alpha", 1f, 0.5f);
ValueAnimator scaleX = ObjectAnimator.ofFloat(dot, "scaleX", 1f, 0.7f);
ValueAnimator scaleY = ObjectAnimator.ofFloat(dot, "scaleY", 1f, 0.7f);
fadeIn.setDuration(mAnimDuration);
fadeIn.setInterpolator(new AccelerateDecelerateInterpolator());
fadeIn.setRepeatMode(ValueAnimator.REVERSE);
fadeIn.setRepeatCount(ValueAnimator.INFINITE);
scaleX.setDuration(mAnimDuration);
scaleX.setInterpolator(new AccelerateDecelerateInterpolator());
scaleX.setRepeatMode(ValueAnimator.REVERSE);
scaleX.setRepeatCount(ValueAnimator.INFINITE);
scaleY.setDuration(mAnimDuration);
scaleY.setInterpolator(new AccelerateDecelerateInterpolator());
scaleY.setRepeatMode(ValueAnimator.REVERSE);
scaleY.setRepeatCount(ValueAnimator.INFINITE);
// bounce.setDuration(mAnimDuration);
// bounce.setInterpolator(new AccelerateDecelerateInterpolator());
// bounce.setRepeatMode(ValueAnimator.REVERSE);
// bounce.setRepeatCount(ValueAnimator.INFINITE);
// mAnimSet.play(bounce).after(startDelay);
mAnimSet.play(fadeIn).after(startDelay);
mAnimSet.play(scaleX).with(fadeIn);
mAnimSet.play(scaleY).with(fadeIn);
mAnimSet.setStartDelay(500);
startDelay += (mAnimDuration / (mImageViewList.size() - 1));
}
mAnimSet.start();
}