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


Java ValueAnimator.setRepeatCount方法代码示例

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


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

示例1: createAnimation

import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public List<Animator> createAnimation() {
    List<Animator> animators=new ArrayList<>();
    long[] delays=new long[]{500,250,0,250,500};
    for (int i = 0; i < 5; i++) {
        final int index=i;
        ValueAnimator scaleAnim=ValueAnimator.ofFloat(1,0.3f,1);
        scaleAnim.setDuration(900);
        scaleAnim.setRepeatCount(-1);
        scaleAnim.setStartDelay(delays[i]);
        scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                scaleYFloats[index] = (float) animation.getAnimatedValue();
                postInvalidate();
            }
        });
        scaleAnim.start();
        animators.add(scaleAnim);
    }
    return animators;
}
 
开发者ID:Mrqinlei,项目名称:ImitateZHRB,代码行数:23,代码来源:LineScalePulseOutIndicator.java

示例2: start

import android.animation.ValueAnimator; //导入方法依赖的package包/类
public ShapeAnimator start(){
    //do not use AnimatorSet because you cannot use setRepeatCount
    for (ValueAnimator animator : animators) {
        animator.setRepeatCount(repeatCount);
        animator.setDuration(duration);
        animator.setStartDelay(startDelay);
        animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                if (view != null) {
                    view.postInvalidate();
                }
            }
        });
        animator.start();
    }
    return this;
}
 
开发者ID:florent37,项目名称:MyLittleCanvas,代码行数:19,代码来源:ShapeAnimator.java

示例3: createAnimation

import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public List<Animator> createAnimation() {
    List<Animator> animators=new ArrayList<>();
    long[] durations=new long[]{1260, 430, 1010, 730};
    long[] delays=new long[]{770, 290, 280, 740};
    for (int i = 0; i < 4; i++) {
        final int index=i;
        ValueAnimator scaleAnim=ValueAnimator.ofFloat(1,0.4f,1);
        scaleAnim.setDuration(durations[i]);
        scaleAnim.setRepeatCount(-1);
        scaleAnim.setStartDelay(delays[i]);
        scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                scaleFloats[index] = (float) animation.getAnimatedValue();
                postInvalidate();
            }
        });
        scaleAnim.start();
        animators.add(scaleAnim);
    }
    return animators;
}
 
开发者ID:zhouphenix,项目名称:Multi-SwipeToRefreshLayout,代码行数:24,代码来源:LineScalePartyIndicator.java

示例4: createAnimation

import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public List<Animator> createAnimation() {
    List<Animator> animators=new ArrayList<>();
    long[] delays=new long[]{100,200,300,400,500};
    for (int i = 0; i < 5; i++) {
        final int index=i;
        ValueAnimator scaleAnim=ValueAnimator.ofFloat(1, 0.4f, 1);
        scaleAnim.setDuration(1000);
        scaleAnim.setRepeatCount(-1);
        scaleAnim.setStartDelay(delays[i]);
        scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                scaleYFloats[index] = (float) animation.getAnimatedValue();
                postInvalidate();
            }
        });
        scaleAnim.start();
        animators.add(scaleAnim);
    }
    return animators;
}
 
开发者ID:magicbaby810,项目名称:SRecyclerView,代码行数:23,代码来源:LineScaleIndicator.java

示例5: createAnimators

import android.animation.ValueAnimator; //导入方法依赖的package包/类
private void createAnimators() {
    mAnimators = new ArrayList<>();
    int[] delays = new int[]{120, 240, 360};
    for (int i = 0; i < 3; i++) {
        final int index = i;

        ValueAnimator scaleAnim = ValueAnimator.ofFloat(1, 0.3f, 1);

        scaleAnim.setDuration(750);
        scaleAnim.setRepeatCount(ValueAnimator.INFINITE);
        scaleAnim.setStartDelay(delays[i]);

        mUpdateListeners.put(scaleAnim, animation -> {
            scaleFloats[index] = (float) animation.getAnimatedValue();
            postInvalidate();
        });
        mAnimators.add(scaleAnim);
    }
}
 
开发者ID:Brave-wan,项目名称:SmartRefresh,代码行数:20,代码来源:BallPulseView.java

示例6: endAnimation

import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void endAnimation(DynamicWeatherView dynamicWeatherView, Animator.AnimatorListener listener) {
    super.endAnimation(dynamicWeatherView, listener);
    ValueAnimator animator = ValueAnimator.ofFloat(getWidth() - bitmap.getWidth() * 0.25f, getWidth());
    animator.setDuration(1000);
    animator.setRepeatCount(0);
    animator.setInterpolator(new AccelerateInterpolator());
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            transFactor = (float) animation.getAnimatedValue();
        }
    });
    if (listener != null) {
        animator.addListener(listener);
    }
    animator.start();
}
 
开发者ID:li-yu,项目名称:FakeWeather,代码行数:19,代码来源:HailType.java

示例7: createAnimation

import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public List<Animator> createAnimation() {
    List<Animator> animators=new ArrayList<>();
    int[] delays=new int[]{120,240,360};
    for (int i = 0; i < 3; i++) {
        final int index=i;
        
        ValueAnimator scaleAnim=ValueAnimator.ofFloat(1,0.3f,1);
        
        scaleAnim.setDuration(750);
        scaleAnim.setRepeatCount(-1);
        scaleAnim.setStartDelay(delays[i]);
        
        scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                scaleFloats[index] = (float) animation.getAnimatedValue();
                postInvalidate();

            }
        });
        scaleAnim.start();
        animators.add(scaleAnim);
    }
    return animators;
}
 
开发者ID:Mrqinlei,项目名称:ImitateZHRB,代码行数:27,代码来源:BallPulseIndicator.java

示例8: endAnimation

import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void endAnimation(DynamicWeatherView dynamicWeatherView, Animator.AnimatorListener listener) {
    super.endAnimation(dynamicWeatherView, listener);
    dynamicWeatherView.removeCallbacks(flashRunnable);
    ValueAnimator animator = ValueAnimator.ofFloat(getWidth() - bitmap.getWidth() * 0.2f, getWidth());
    animator.setDuration(1000);
    animator.setRepeatCount(0);
    animator.setInterpolator(new AccelerateInterpolator());
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            transFactor = (float) animation.getAnimatedValue();
        }
    });
    if (listener != null) {
        animator.addListener(listener);
    }
    animator.start();
}
 
开发者ID:li-yu,项目名称:FakeWeather,代码行数:20,代码来源:RainType.java

示例9: startAnimation

import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void startAnimation(DynamicWeatherView dynamicWeatherView, int fromColor) {
    super.startAnimation(dynamicWeatherView, fromColor);
    ValueAnimator animator = ValueAnimator.ofFloat(-bitmap.getWidth() * 0.25f, getWidth() - bitmap.getWidth() * 0.25f);
    animator.setDuration(1000);
    animator.setRepeatCount(0);
    animator.setInterpolator(new OvershootInterpolator());
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            transFactor = (float) animation.getAnimatedValue();
        }
    });

    animator.start();
}
 
开发者ID:li-yu,项目名称:FakeWeather,代码行数:17,代码来源:HailType.java

示例10: createAnimation

import android.animation.ValueAnimator; //导入方法依赖的package包/类
public List<Animator> createAnimation() {
    List<Animator> animators = new ArrayList<>();
    int[] delays = new int[]{120, 240, 360};
    for (int i = 0; i < 3; i++) {
        final int index = i;

        ValueAnimator scaleAnim = ValueAnimator.ofFloat(1, 0.3f, 1);

        scaleAnim.setDuration(750);
        scaleAnim.setRepeatCount(-1);
        scaleAnim.setStartDelay(delays[i]);

        scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                scaleFloats[index] = (float) animation.getAnimatedValue();
                postInvalidate();

            }
        });
        scaleAnim.start();
        animators.add(scaleAnim);
    }
    return animators;
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:26,代码来源:ProgressIndicatorView.java

示例11: createAnimation

import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public List<Animator> createAnimation() {
    List<Animator> animators=new ArrayList<>();

    int[] durations={960, 930, 1190, 1130, 1340, 940, 1200, 820, 1190};
    int[] delays= {360, 400, 680, 410, 710, -150, -120, 10, 320};

    for (int i = 0; i < 9; i++) {
        final int index=i;
        ValueAnimator alphaAnim=ValueAnimator.ofInt(255, 168,255);
        alphaAnim.setDuration(durations[i]);
        alphaAnim.setRepeatCount(-1);
        alphaAnim.setStartDelay(delays[i]);
        alphaAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                alphas[index] = (int) animation.getAnimatedValue();
                postInvalidate();
            }
        });
        alphaAnim.start();
        animators.add(alphaAnim);
    }
    return animators;
}
 
开发者ID:magicbaby810,项目名称:SRecyclerView,代码行数:26,代码来源:BallGridBeatIndicator.java

示例12: createBallPulseAnimators

import android.animation.ValueAnimator; //导入方法依赖的package包/类
public ArrayList<ValueAnimator> createBallPulseAnimators() {
    ArrayList<ValueAnimator> animators = new ArrayList<>();
    int[] delays = new int[]{120, 240, 360};
    for (int i = 0; i < 3; i++) {
        final int index = i;

        ValueAnimator scaleAnim = ValueAnimator.ofFloat(1, 0.3f, 1);

        scaleAnim.setDuration(750);
        scaleAnim.setRepeatCount(-1);
        scaleAnim.setStartDelay(delays[i]);

        scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                scaleFloats[index] = (float) animation.getAnimatedValue();
                postInvalidate();
            }
        });
        animators.add(scaleAnim);
    }
    return animators;
}
 
开发者ID:hiwhitley,项目名称:DownloadProgressButton,代码行数:24,代码来源:DownloadProgressButton.java

示例13: createAnimation

import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public List<Animator> createAnimation() {
    List<Animator> animators=new ArrayList<>();
    long[] delays=new long[]{400,200,0,200,400};
    for (int i = 0; i < 5; i++) {
        final int index=i;
        ValueAnimator scaleAnim=ValueAnimator.ofFloat(1,0.4f,1);
        scaleAnim.setDuration(1000);
        scaleAnim.setRepeatCount(-1);
        scaleAnim.setStartDelay(delays[i]);
        scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                scaleYFloats[index] = (float) animation.getAnimatedValue();
                postInvalidate();
            }
        });
        scaleAnim.start();
        animators.add(scaleAnim);
    }
    return animators;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:LineScalePulseOutRapidIndicator.java

示例14: createAnimators

import android.animation.ValueAnimator; //导入方法依赖的package包/类
/**
 * 创建动画
 *
 * @param time
 */
private void createAnimators(long time) {
    mAnimators = new ArrayList<>();
    long[] delays = new long[]{100, 200, 300};
    for (int i = 0; i < 3; i++) {
        final int index = i;
        ValueAnimator scaleAnim = ValueAnimator.ofFloat(1, 0.4f, 1);
        scaleAnim.setDuration(time);
        scaleAnim.setRepeatCount(-1);
        scaleAnim.setStartDelay(delays[i]);
        scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                scaleFloats[index] = (float) animation.getAnimatedValue();
                postInvalidate();
            }
        });
        scaleAnim.start();
        mAnimators.add(scaleAnim);
    }
}
 
开发者ID:zyyoona7,项目名称:MyLoadingViews,代码行数:26,代码来源:AdidasLoadingView.java

示例15: createAnimation

import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public List<Animator> createAnimation() {
    List<Animator> animators=new ArrayList<>();
    ValueAnimator scaleAnim=ValueAnimator.ofFloat(0.5f,1,0.5f);
    scaleAnim.setDuration(1000);
    scaleAnim.setRepeatCount(-1);
    scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            scaleFloat = (float) animation.getAnimatedValue();
            postInvalidate();
        }
    });
    scaleAnim.start();

    ObjectAnimator rotateAnim=ObjectAnimator.ofFloat(getTarget(),"rotation",0,180,360);
    rotateAnim.setDuration(1000);
    rotateAnim.setRepeatCount(-1);
    rotateAnim.start();

    animators.add(scaleAnim);
    animators.add(rotateAnim);
    return animators;
}
 
开发者ID:zhouphenix,项目名称:Multi-SwipeToRefreshLayout,代码行数:25,代码来源:BallRotateIndicator.java


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