java类android.view.animation.DecelerateInterpolator的实例源码

CalorieCounterView.java 文件源码 项目:DroidCalorieCounterView 阅读 26 收藏 0 点赞 0 评论 0
/**
 * Set the progress with an animation for the calorie counter
 *
 * @param progress The progress it should animate to it
 */
public void setProgressWithAnimation(int progress) {
    ObjectAnimator objectAnimator = ObjectAnimator.ofInt(this, "progress", progress);
    objectAnimator.setDuration(1500);
    objectAnimator.setInterpolator(new DecelerateInterpolator());
    objectAnimator.start();
}
AnimProcessor.java 文件源码 项目:GitHub 阅读 24 收藏 0 点赞 0 评论 0
public void animLayoutByTime(int start, int end, long time, AnimatorUpdateListener listener) {
    ValueAnimator va = ValueAnimator.ofInt(start, end);
    va.setInterpolator(new DecelerateInterpolator());
    va.addUpdateListener(listener);
    va.setDuration(time);
    va.start();
}
AnimationManager.java 文件源码 项目:AndroidPdfViewerV2 阅读 25 收藏 0 点赞 0 评论 0
public void startYAnimation(float yFrom, float yTo) {
    stopAll();
    animation = ValueAnimator.ofFloat(yFrom, yTo);
    YAnimation yAnimation = new YAnimation();
    animation.setInterpolator(new DecelerateInterpolator());
    animation.addUpdateListener(yAnimation);
    animation.addListener(yAnimation);
    animation.setDuration(400);
    animation.start();
}
AnimationTextView.java 文件源码 项目:AnimationTextView 阅读 30 收藏 0 点赞 0 评论 0
/**
 * 提供设置数值的方法
 * @param Num
 */
public void setMaxNum(int Num) {
    ObjectAnimator o = ObjectAnimator.ofInt(this, "num", 0, Num);
    o.setDuration(2000);
    o.setInterpolator(new DecelerateInterpolator());
    o.start();
}
WaterDropView.java 文件源码 项目:GitHub 阅读 25 收藏 0 点赞 0 评论 0
/**
 * 创建回弹动画
 * 上圆半径减速恢复至最大半径
 * 下圆半径减速恢复至最大半径
 * 圆心距减速从最大值减到0(下圆Y从当前位置移动到上圆Y)。
 */
public Animator createAnimator() {
    ValueAnimator valueAnimator = ValueAnimator.ofFloat(1, 0.001f).setDuration(BACK_ANIM_DURATION);
    valueAnimator.setInterpolator(new DecelerateInterpolator());
    valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator valueAnimator1) {
            WaterDropView.this.updateComleteState((float) valueAnimator1.getAnimatedValue());
            WaterDropView.this.postInvalidate();
        }
    });
    return valueAnimator;
}
AnimationHelper.java 文件源码 项目:Rotate3d 阅读 30 收藏 0 点赞 0 评论 0
public static Animation createRotate3dEnterAnimation() {
    final Rotate3dAnimation animation = new Rotate3dAnimation(270, 360, false);
    animation.setDuration(600);
    animation.setStartOffset(300);
    animation.setFillAfter(false);
    animation.setInterpolator(new DecelerateInterpolator());
    return animation;
}
BatteryProgressView.java 文件源码 项目:BatteryProgressView 阅读 24 收藏 0 点赞 0 评论 0
public void setProgress(int progress) {
    lastProgress=this.progress;
    this.progress = progress;
    post(new Runnable() {
        @Override
        public void run() {
            float incr=360/maxProgress;
            Log.e("pogress","last:"+lastProgress+",progress:"+BatteryProgressView.this.progress);
            if(lastProgress<BatteryProgressView.this.progress) {
                Log.e("first",lastProgress+" to "+ (incr * (BatteryProgressView.this.progress))+":"+lastProgress);
                animator = ValueAnimator.ofFloat(incr*lastProgress, incr * (BatteryProgressView.this.progress));
                animator.setDuration(800);
                animator.addUpdateListener(animatorUpdateListener);
                animator.setInterpolator(new DecelerateInterpolator());
                animator.start();
            }else {
                Log.e("second",lastProgress+" to "+ (incr * (BatteryProgressView.this.progress))+":"+lastProgress);
                animator = ValueAnimator.ofFloat((incr*lastProgress), incr * (BatteryProgressView.this.progress));
                animator.setDuration(800);
                animator.addUpdateListener(animatorUpdateListener);
                animator.setInterpolator(new DecelerateInterpolator());
                animator.start();
            }
        }
    });

}
ImageAnimationHelper.java 文件源码 项目:GitHub 阅读 28 收藏 0 点赞 0 评论 0
public static void fadeInDisplay(final ImageView imageView, Drawable drawable) {
    AlphaAnimation fadeAnimation = new AlphaAnimation(0F, 1F);
    fadeAnimation.setDuration(300);
    fadeAnimation.setInterpolator(new DecelerateInterpolator());
    imageView.setImageDrawable(drawable);
    imageView.startAnimation(fadeAnimation);
}
FadeScaleViewAnimProvider.java 文件源码 项目:stateLayout 阅读 26 收藏 0 点赞 0 评论 0
@Override
public Animation hideAnimation() {
    AnimationSet set = new AnimationSet(true);
    Animation alphaAnimation = new AlphaAnimation(1.0f, 0.0f);
    Animation scaleAnimation = new ScaleAnimation(1.0f, 0.1f, 1.0f, 0.1f, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);

    set.setDuration(200);
    set.setInterpolator(new DecelerateInterpolator());
    set.addAnimation(alphaAnimation);
    set.addAnimation(scaleAnimation);
    return set;
}
AnimatingLineChartFragment.java 文件源码 项目:SciChart.Android.Examples 阅读 24 收藏 0 点赞 0 评论 0
private AnimatingLineRenderableSeries() {
    animator = ValueAnimator.ofFloat(START_VALUE, END_VALUE);
    animator.setInterpolator(new DecelerateInterpolator());
    animator.setDuration(TIME_INTERVAL);
    animator.addUpdateListener(this);
    animator.addListener(this);
}


问题


面经


文章

微信
公众号

扫码关注公众号