java类android.animation.ObjectAnimator的实例源码

ChartAnimator.java 文件源码 项目:GitHub 阅读 36 收藏 0 点赞 0 评论 0
/**
 * Animates the rendering of the chart on the x-axis with the specified
 * animation time. If animate(...) is called, no further calling of
 * invalidate() is necessary to refresh the chart.
 *
 * @param durationMillis
 * @param easing
 */
public void animateX(int durationMillis, EasingFunction easing) {

    if (android.os.Build.VERSION.SDK_INT < 11)
        return;

    ObjectAnimator animatorX = ObjectAnimator.ofFloat(this, "phaseX", 0f, 1f);
    animatorX.setInterpolator(easing);
    animatorX.setDuration(durationMillis);
    animatorX.addUpdateListener(mListener);
    animatorX.start();
}
RollOutAnimatorDecoration.java 文件源码 项目:LuaViewPlayground 阅读 27 收藏 0 点赞 0 评论 0
@Override
protected void prepare(AnimatorSet animatorSet, View target) {
    animatorSet.playTogether(
            ObjectAnimator.ofFloat(target, "alpha", 1, 0),
            ObjectAnimator.ofFloat(target, "translationX", 0, target.getWidth()),
            ObjectAnimator.ofFloat(target, "rotation", 0, 120)
    );
}
QsbBlockerView.java 文件源码 项目:SimpleUILauncher 阅读 28 收藏 0 点赞 0 评论 0
@Override
public void prepareStateChange(State toState, AnimatorSet targetAnim) {
    int finalAlpha = getAlphaForState(toState);
    if (targetAnim == null) {
        mBgPaint.setAlpha(finalAlpha);
        invalidate();
    } else {
        ObjectAnimator anim = ObjectAnimator.ofArgb(mBgPaint, "alpha", finalAlpha);
        anim.addUpdateListener(new AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                invalidate();
            }
        });
        targetAnim.play(anim);
    }
}
ZoomInLeftAnimatorDecoration.java 文件源码 项目:LuaViewPlayground 阅读 25 收藏 0 点赞 0 评论 0
@Override
protected void prepare(AnimatorSet animatorSet, View target) {
    animatorSet.playTogether(
            ObjectAnimator.ofFloat(target, "scaleX", 0.1f, 0.475f, 1),
            ObjectAnimator.ofFloat(target, "scaleY", 0.1f, 0.475f, 1),
            ObjectAnimator.ofFloat(target, "translationX", -target.getRight(), 48, 0),
            ObjectAnimator.ofFloat(target, "alpha", 0, 1, 1)
    );
}
SlideRight.java 文件源码 项目:Flubber 阅读 26 收藏 0 点赞 0 评论 0
@Override
public Animator getAnimationFor(AnimationBody animationBody, View view) {

    final float startY = DimensionUtils.dp2px(-800);
    final float endY = 0f;

    final PropertyValuesHolder translationPVH =
            PropertyValuesHolder.ofFloat(View.TRANSLATION_X, startY, endY);

    final ObjectAnimator animation =
            ObjectAnimator.ofPropertyValuesHolder(view, translationPVH);

    return animation;
}
ZoomInLeftAnimator.java 文件源码 项目:KUtils-master 阅读 27 收藏 0 点赞 0 评论 0
@Override
public void prepare(View target) {
    getAnimatorAgent().playTogether(
            ObjectAnimator.ofFloat(target, "scaleX", 0.1f, 0.475f, 1),
            ObjectAnimator.ofFloat(target, "scaleY", 0.1f, 0.475f, 1),
            ObjectAnimator.ofFloat(target, "translationX", -target.getRight(), 48, 0),
            ObjectAnimator.ofFloat(target, "alpha", 0, 1, 1)
    );
}
MultiFloatingActionButton.java 文件源码 项目:ReadMark 阅读 29 收藏 0 点赞 0 评论 0
private void scaleToShow(){
    for(int i = 2; i<getChildCount(); i++){
        View view = getChildAt(i);
        view.setVisibility(VISIBLE);
        view.setAlpha(0);
        ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 0f, 1f);
        ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 0f, 1f);
        ObjectAnimator alpha = ObjectAnimator.ofFloat(view, "alpha", 0f, 1f);
        AnimatorSet set = new AnimatorSet();
        set.playTogether(scaleX, scaleY, alpha);
        set.setDuration(mAnimationDuration);
        set.start();
    }
}
ObjectAnimatorProxy.java 文件源码 项目:PlusGram 阅读 74 收藏 0 点赞 0 评论 0
public static Object ofInt(Object target, String propertyName, int... values) {
    if (View10.NEED_PROXY) {
        return ObjectAnimator10.ofInt(target, propertyName, values);
    } else {
        return ObjectAnimator.ofInt(target, propertyName, values);
    }
}
MaterialRippleLayout.java 文件源码 项目:VirtualHook 阅读 34 收藏 0 点赞 0 评论 0
private void startHover() {
    if (eventCancelled) return;

    if (hoverAnimator != null) {
        hoverAnimator.cancel();
    }
    final float radius = (float) (Math.sqrt(Math.pow(getWidth(), 2) + Math.pow(getHeight(), 2)) * 1.2f);
    hoverAnimator = ObjectAnimator.ofFloat(this, radiusProperty, rippleDiameter, radius)
        .setDuration(HOVER_DURATION);
    hoverAnimator.setInterpolator(new LinearInterpolator());
    hoverAnimator.start();
}
SearchArrowDrawable.java 文件源码 项目:Sega 阅读 33 收藏 0 点赞 0 评论 0
void animate(float state, int duration) {
    ObjectAnimator anim;
    if (state == STATE_ARROW) {
        anim = ObjectAnimator.ofFloat(this, PROGRESS, state, STATE_HAMBURGER);
    } else {
        anim = ObjectAnimator.ofFloat(this, PROGRESS, state, STATE_ARROW);
    }
    anim.setInterpolator(new AccelerateDecelerateInterpolator());
    anim.setDuration(duration);
    anim.start();
}


问题


面经


文章

微信
公众号

扫码关注公众号