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


Java ValueAnimator.AnimatorUpdateListener方法代码示例

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


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

示例1: startAnim

import android.animation.ValueAnimator; //导入方法依赖的package包/类
public void startAnim() {
    if (mAnimators == null) createAnimators();
    if (mAnimators == null) return;
    if (isStarted()) return;

    for (int i = 0; i < mAnimators.size(); i++) {
        ValueAnimator animator = mAnimators.get(i);

        //when the animator restart , add the updateListener again because they was removed by animator stop .
        ValueAnimator.AnimatorUpdateListener updateListener = mUpdateListeners.get(animator);
        if (updateListener != null) {
            animator.addUpdateListener(updateListener);
        }
        animator.start();
    }
    mIsStarted = true;
    setIndicatorColor(animatingColor);
}
 
开发者ID:penghuanliang,项目名称:Rxjava2.0Demo,代码行数:19,代码来源:BallPulseView.java

示例2: onAnimationUpdate

import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
    if (DEBUG) {
        log("Animation update "
                + animation.getAnimatedFraction() + " on: "
                + Thread.currentThread().getName());
    }

    mBackgroundFraction = animation.getAnimatedFraction();

    // propagate the animation event to all listeners
    for (ValueAnimator.AnimatorUpdateListener listener : mAnimationListenerCache) {
        listener.onAnimationUpdate(animation);
    }

    // animation updates occur on the main thread. it is save to call invalidate here.
    PieLayout.this.invalidate();
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:19,代码来源:PieLayout.java

示例3: startAnim

import android.animation.ValueAnimator; //导入方法依赖的package包/类
public void startAnim() {
    if (mAnimators == null) createAnimators();
    if (mAnimators == null) return;
    if (isStarted()) return;

    for (int i = 0; i < mAnimators.size(); i++) {
        ValueAnimator animator = mAnimators.get(i);

        //when the animator restart , add the updateListener again because they was removed by animator stop .
        ValueAnimator.AnimatorUpdateListener updateListener = mUpdateListeners.get(animator);
        if (updateListener != null) {
            animator.addUpdateListener(updateListener);
        }
        animator.start();
    }
    setIndicatorColor(animatingColor);
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:18,代码来源:BallPulseView.java

示例4: initAnimation

import android.animation.ValueAnimator; //导入方法依赖的package包/类
/**
 * 初始化动画效果
 *
 * @param name         String类型的名称,用于标记需要初始化动画的图形
 * @param enabled      是否开启动画效果
 * @param animDuration 动画执行时长
 */
public void initAnimation(String name, boolean enabled, long animDuration) {
    if (null == name)
        return;

    final EasyAnimationEntity animationEntity = new EasyAnimationEntity();
    animationEntity.isAnimationEnabled = enabled;
    animationEntity.animDuration = animDuration;
    animationEntity.animUpdateListener = new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            animationEntity.animatorValue = (float) animation.getAnimatedValue();
            invalidate();
        }
    };
    animationMap.put(name, animationEntity);
}
 
开发者ID:huzenan,项目名称:EasyChart,代码行数:24,代码来源:EasyCoordinate.java

示例5: activate

import android.animation.ValueAnimator; //导入方法依赖的package包/类
public void activate(Point center, Position position) {
    if (Looper.myLooper() != Looper.getMainLooper()) {
        log("Activation not on main thread: " + Thread.currentThread().getName());
    }

    if (DEBUG) mActivateStartDebug = SystemClock.uptimeMillis();

    mPosition = position;
    mLayoutDoneForPosition = null;
    mActive = true;

    // Set the activation center as center of the pie
    // This will be corrected by the #onLayout call.
    mCenter = center;

    mAnimationListenerCache.clear();
    for (PieSlice slice : mSlices) {
        if (slice instanceof ValueAnimator.AnimatorUpdateListener) {
            mAnimationListenerCache.add((ValueAnimator.AnimatorUpdateListener)slice);
        }
    }

    mBackgroundFraction = 0.0f;
    mBackgroundAnimator.setStartDelay(mLongpressDelay+500);
    if (!mSysinfoDisabled) {
        mBackgroundAnimator.start();
    }

    setVisibility(View.VISIBLE);

    if (DEBUG) {
        log("activate finished within "
                + (SystemClock.uptimeMillis() - mActivateStartDebug) + " ms");
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:36,代码来源:PieLayout.java

示例6: startAnimators

import android.animation.ValueAnimator; //导入方法依赖的package包/类
private void startAnimators() {
    for (int i = 0; i < mAnimators.size(); i++) {
        ValueAnimator animator = mAnimators.get(i);

        //when the progressAnimator restart , add the updateListener again because they
        // was removed by progressAnimator stop .
        ValueAnimator.AnimatorUpdateListener updateListener = mUpdateListeners.get(animator);
        if (updateListener != null) {
            animator.addUpdateListener(updateListener);
        }

        animator.start();
    }
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:15,代码来源:Indicator.java

示例7: createAnimatorUpdateListener

import android.animation.ValueAnimator; //导入方法依赖的package包/类
/**
 * Create an animator update listener to be used to update the drawable to be animated.
 *
 * @param drawable the drawable to create the animator update listener for
 * @return the listener to use
 */
@Nullable
public static ValueAnimator.AnimatorUpdateListener createAnimatorUpdateListener(
    final Drawable drawable) {
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    return null;
  }

  if (drawable instanceof AnimatedDrawable2) {
    return AnimatedDrawable2ValueAnimatorHelper.createAnimatorUpdateListener(
        (AnimatedDrawable2) drawable);
  }
  return null;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:AnimatedDrawableValueAnimatorHelper.java

示例8: startAnimators

import android.animation.ValueAnimator; //导入方法依赖的package包/类
private void startAnimators() {
    if (animators != null) {
        final Set<Map.Entry<ValueAnimator, ValueAnimator.AnimatorUpdateListener>> entries = animators.entrySet();
        for (Map.Entry<ValueAnimator, ValueAnimator.AnimatorUpdateListener> entry : entries) {
            ValueAnimator.AnimatorUpdateListener updateListener = entry.getValue();
            final ValueAnimator animator = entry.getKey();
            if (updateListener != null) {
                animator.addUpdateListener(updateListener);
            }
            animator.start();
        }
    }
}
 
开发者ID:Adyen,项目名称:adyen-android,代码行数:14,代码来源:Animation.java

示例9: animationAddUpdateListener

import android.animation.ValueAnimator; //导入方法依赖的package包/类
public RxAnimatorObservable animationAddUpdateListener(ValueAnimator.AnimatorUpdateListener animatorUpdateListener) {
    if (this.animatorUpdateListeners == null) {
        this.animatorUpdateListeners = new ArrayList<>();
    }
    this.animatorUpdateListeners.add(animatorUpdateListener);
    return this;
}
 
开发者ID:datalink747,项目名称:Rx_java2_soussidev,代码行数:8,代码来源:RxAnimator_java.java

示例10: getOnTranslateYAnimationUpdate

import android.animation.ValueAnimator; //导入方法依赖的package包/类
/**
 * 重置垂直动画的监听器
 *
 * @return
 */
public ValueAnimator.AnimatorUpdateListener getOnTranslateYAnimationUpdate() {
    if (onTranslateYAnimationUpdate != null) return onTranslateYAnimationUpdate;
    onTranslateYAnimationUpdate = new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            translateTop = (float) animation.getAnimatedValue();
            invalidate();
        }
    };
    return onTranslateYAnimationUpdate;
}
 
开发者ID:hsj-xiaokang,项目名称:OSchina_resources_android,代码行数:17,代码来源:ImagePreviewView.java

示例11: createAnimator

import android.animation.ValueAnimator; //导入方法依赖的package包/类
private void createAnimator() {
        mAnimator = ValueAnimator.ofInt(RES_IDS.length - 1);
        mAnimator.setInterpolator(new LinearInterpolator());
        mAnimator.setRepeatCount(ValueAnimator.INFINITE);
        mAnimator.setRepeatMode(ValueAnimator.RESTART);
        mAnimator.setDuration(RES_IDS.length / fps * 1000);

        mAnimUpdateListener = new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                invalidate(((int) animation.getAnimatedValue()));
//                System.out.println("FrameAnimDrawable onAnimationUpdate resIndex "+resIndex);
            }
        };
    }
 
开发者ID:yangjiantao,项目名称:AndroidUiKit,代码行数:16,代码来源:FrameAnimDrawable.java

示例12: startAnimators

import android.animation.ValueAnimator; //导入方法依赖的package包/类
private void startAnimators() {
    for (int i = 0; i < mAnimators.size(); i++) {
        ValueAnimator animator = mAnimators.get(i);

        //when the animator restart , add the updateListener again because they
        // was removed by animator stop .
        ValueAnimator.AnimatorUpdateListener updateListener = mUpdateListeners.get(animator);
        if (updateListener != null) {
            animator.addUpdateListener(updateListener);
        }

        animator.start();
    }
}
 
开发者ID:yedashen,项目名称:UltimateRecyclerView,代码行数:15,代码来源:Indicator.java

示例13: startToMaxAnim

import android.animation.ValueAnimator; //导入方法依赖的package包/类
/**
 * 视图从一个中心点坐标, 平移放大到结束点坐标
 */
public static ValueAnimator startToMaxAnim(Rect startRect, final View targetView,
                                           Point from, Point to,
                                           int maxWidth, int maxHeight, final long startDelay,
                                           Animator.AnimatorListener listener) {
    startRect = ensureRect(startRect);

    int statusBarHeight = 0;
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
        statusBarHeight = RApplication.getApp().getResources().getDimensionPixelOffset(R.dimen.status_bar_height);
    }

    final Point startPoint = new Point(from.x, from.y - statusBarHeight);
    final Point endPoint = new Point(to.x, to.y - statusBarHeight);

    final int targetWidth = Math.min(ScreenUtil.screenWidth, maxWidth);
    final int targetHeight = Math.min(ScreenUtil.screenHeight, maxHeight);

    final float startScaleX = startRect.width() * 1f / targetWidth;
    final float startScaleY = startRect.height() * 1f / targetHeight;

    final ValueAnimator animator = ValueAnimator.ofFloat(0f, 1f);
    animator.addListener(listener);

    final ValueAnimator.AnimatorUpdateListener updateListener = new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            float value = (float) animation.getAnimatedValue();

            updateMaxValue(targetView, startScaleX, startScaleY, startPoint, endPoint, value);

            notifyAnimProgress(animation, animation.getAnimatedFraction());
        }
    };

    animator.addUpdateListener(updateListener);

    animator.setDuration(UIIViewImpl.DEFAULT_FINISH_ANIM_TIME);
    if (startDelay > 0) {
        animator.setStartDelay(startDelay);
    }
    animator.setInterpolator(new DecelerateInterpolator());

    if (targetView.getMeasuredWidth() == 0 || targetView.getMeasuredHeight() == 0) {
        targetView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
            @Override
            public boolean onPreDraw() {
                if (startDelay > 0) {
                    updateMaxValue(targetView, startScaleX, startScaleY, startPoint, endPoint, 0);
                }
                notifyAnimDelayStart(animator);
                animator.start();
                targetView.getViewTreeObserver().removeOnPreDrawListener(this);
                return false;
            }
        });
    } else {
        if (startDelay > 0) {
            updateMaxValue(targetView, startScaleX, startScaleY, startPoint, endPoint, 0);
        }
        notifyAnimDelayStart(animator);
        animator.start();
    }

    return animator;
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:69,代码来源:AnimUtil.java

示例14: removeAnimatorUpdateListener

import android.animation.ValueAnimator; //导入方法依赖的package包/类
@SuppressWarnings("WeakerAccess") public void removeAnimatorUpdateListener(ValueAnimator.AnimatorUpdateListener updateListener) {
  animator.removeUpdateListener(updateListener);
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:4,代码来源:LottieDrawable.java

示例15: removeUpdateListener

import android.animation.ValueAnimator; //导入方法依赖的package包/类
@SuppressWarnings("unused")
public void removeUpdateListener(ValueAnimator.AnimatorUpdateListener updateListener) {
  lottieDrawable.removeAnimatorUpdateListener(updateListener);
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:5,代码来源:LottieAnimationView.java


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