类android.animation.IntEvaluator源码实例Demo

下面列出了怎么用android.animation.IntEvaluator的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Android-Image-Slider   文件: FillAnimation.java
@NonNull
private PropertyValuesHolder createRadiusPropertyHolder(boolean isReverse) {
    String propertyName;
    int startRadiusValue;
    int endRadiusValue;

    if (isReverse) {
        propertyName = ANIMATION_RADIUS_REVERSE;
        startRadiusValue = radius / 2;
        endRadiusValue = radius;
    } else {
        propertyName = ANIMATION_RADIUS;
        startRadiusValue = radius;
        endRadiusValue = radius / 2;
    }

    PropertyValuesHolder holder = PropertyValuesHolder.ofInt(propertyName, startRadiusValue, endRadiusValue);
    holder.setEvaluator(new IntEvaluator());

    return holder;
}
 
源代码2 项目: Android-Image-Slider   文件: FillAnimation.java
@NonNull
private PropertyValuesHolder createStrokePropertyHolder(boolean isReverse) {
    String propertyName;
    int startStrokeValue;
    int endStrokeValue;

    if (isReverse) {
        propertyName = ANIMATION_STROKE_REVERSE;
        startStrokeValue = radius;
        endStrokeValue = 0;
    } else {
        propertyName = ANIMATION_STROKE;
        startStrokeValue = 0;
        endStrokeValue = radius;
    }

    PropertyValuesHolder holder = PropertyValuesHolder.ofInt(propertyName, startStrokeValue, endStrokeValue);
    holder.setEvaluator(new IntEvaluator());

    return holder;
}
 
源代码3 项目: Android-Image-Slider   文件: ScaleDownAnimation.java
@NonNull
@Override
protected PropertyValuesHolder createScalePropertyHolder(boolean isReverse) {
	String propertyName;
	int startRadiusValue;
	int endRadiusValue;

	if (isReverse) {
		propertyName = ANIMATION_SCALE_REVERSE;
		startRadiusValue = (int) (radius * scaleFactor);
		endRadiusValue = radius;
	} else {
		propertyName = ANIMATION_SCALE;
		startRadiusValue = radius;
		endRadiusValue = (int) (radius * scaleFactor);
	}

	PropertyValuesHolder holder = PropertyValuesHolder.ofInt(propertyName, startRadiusValue, endRadiusValue);
	holder.setEvaluator(new IntEvaluator());

	return holder;
}
 
源代码4 项目: Android-Image-Slider   文件: ScaleAnimation.java
@NonNull
protected PropertyValuesHolder createScalePropertyHolder(boolean isReverse) {
    String propertyName;
    int startRadiusValue;
    int endRadiusValue;

    if (isReverse) {
        propertyName = ANIMATION_SCALE_REVERSE;
        startRadiusValue = radius;
        endRadiusValue = (int) (radius * scaleFactor);
    } else {
        propertyName = ANIMATION_SCALE;
        startRadiusValue = (int) (radius * scaleFactor);
        endRadiusValue = radius;
    }

    PropertyValuesHolder holder = PropertyValuesHolder.ofInt(propertyName, startRadiusValue, endRadiusValue);
    holder.setEvaluator(new IntEvaluator());

    return holder;
}
 
源代码5 项目: Aria   文件: BaseDialog.java
/**
 * 进场动画
 */
private void in() {
  int height = AndroidUtils.getScreenParams(getContext())[1];
  ValueAnimator animator = ValueAnimator.ofObject(new IntEvaluator(), -height / 2, 0);
  animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
    @Override public void onAnimationUpdate(ValueAnimator animation) {
      mWpm.y = (int) animation.getAnimatedValue();
      mWindow.setAttributes(mWpm);
    }
  });
  animator.setInterpolator(new BounceInterpolator()); //弹跳
  Animator alpha = ObjectAnimator.ofFloat(mRootView, "alpha", 0f, 1f);
  AnimatorSet set = new AnimatorSet();
  set.play(animator).with(alpha);
  set.setDuration(2000).start();
}
 
源代码6 项目: Jockey   文件: GestureView.java
/**
 * Animates the overlay to a specified radius, fades it out, and clears the current gesture
 * @param targetRadius The radius to animate the circular overlay to
 * @param time The time for this animation to last
 * @param alphaDelay An optional delay to add before animating the transparency of the overlay
 */
private void animateOutRadius(int targetRadius, int time, int alphaDelay) {
    ObjectAnimator alphaAnim = ObjectAnimator.ofObject(
            this, "overlayAlpha",
            new IntEvaluator(), mAlpha, 0);
    ObjectAnimator radiusAnim = ObjectAnimator.ofObject(
            this, "radius",
            new IntEvaluator(), (isRight() ? radius() : -radius()), targetRadius);

    radiusAnim
            .setDuration(time)
            .setInterpolator(AnimationUtils.loadInterpolator(getContext(),
                    android.R.interpolator.accelerate_quad));
    alphaAnim
            .setDuration(time)
            .setInterpolator(AnimationUtils.loadInterpolator(getContext(),
                    android.R.interpolator.accelerate_quad));

    radiusAnim.start();
    alphaAnim.setStartDelay(alphaDelay);
    alphaAnim.start();
}
 
源代码7 项目: NewFastFrame   文件: BottomFragment.java
@Override
protected void updateView() {
    intEvaluator = new IntEvaluator();
    floatEvaluator = new FloatEvaluator();
    int sameWidth = playOrPause.getLayoutParams().width;
    screenWidth = DensityUtil.getScreenWidth(getContext());
    screenHeight = DensityUtil.getScreenHeight(getContext());
    int margin = ((RelativeLayout.LayoutParams) playOrPause.getLayoutParams()).rightMargin;
    endPlay = screenWidth / 2 - (sameWidth * 2 + margin) + sameWidth / 2;
}
 
源代码8 项目: scene   文件: DrawableAnimationBuilder.java
public DrawableAnimationBuilder alpha(int fromValue, int toValue) {
    hashMap.put(property, new Holder(new IntEvaluator(), fromValue, toValue));
    return this;
}
 
源代码9 项目: scene   文件: ViewOtherAnimationBuilder.java
public T scrollX(int fromValue, int toValue) {
    hashMap.put(SCROLL_X, new Holder(new IntEvaluator(), fromValue, toValue));
    return (T) this;
}
 
源代码10 项目: scene   文件: ViewOtherAnimationBuilder.java
public T scrollY(int fromValue, int toValue) {
    hashMap.put(SCROLL_Y, new Holder(new IntEvaluator(), fromValue, toValue));
    return (T) this;
}
 
源代码11 项目: scene   文件: ImageViewAnimationBuilder.java
public ImageViewAnimationBuilder imageAlpha(int fromValue, int toValue) {
    hashMap.put(IMAGE_ALPHA, new Holder(new IntEvaluator(), fromValue, toValue));
    return this;
}
 
源代码12 项目: Android-Image-Slider   文件: SwapAnimation.java
private PropertyValuesHolder createColorPropertyHolder(String propertyName, int startValue, int endValue) {
    PropertyValuesHolder holder = PropertyValuesHolder.ofInt(propertyName, startValue, endValue);
    holder.setEvaluator(new IntEvaluator());

    return holder;
}
 
源代码13 项目: Android-Image-Slider   文件: SlideAnimation.java
private PropertyValuesHolder createSlidePropertyHolder() {
    PropertyValuesHolder holder = PropertyValuesHolder.ofInt(ANIMATION_COORDINATE, coordinateStart, coordinateEnd);
    holder.setEvaluator(new IntEvaluator());

    return holder;
}
 
源代码14 项目: weex-uikit   文件: DimensionUpdateListener.java
DimensionUpdateListener(@NonNull View view) {
  this.view = view;
  intEvaluator = new IntEvaluator();
}