本文整理了Java中com.nineoldandroids.animation.ObjectAnimator.setRepeatCount()
方法的一些代码示例,展示了ObjectAnimator.setRepeatCount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObjectAnimator.setRepeatCount()
方法的具体详情如下:
包路径:com.nineoldandroids.animation.ObjectAnimator
类名称:ObjectAnimator
方法名:setRepeatCount
暂无
代码示例来源:origin: chiuki/advanced-textview
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_animated_rainbow_span);
final TextView textView = (TextView) findViewById(R.id.text);
String text = textView.getText().toString();
AnimatedColorSpan span = new AnimatedColorSpan(this);
final SpannableString spannableString = new SpannableString(text);
String substring = getString(R.string.animated_rainbow_span).toLowerCase();
int start = text.toLowerCase().indexOf(substring);
int end = start + substring.length();
spannableString.setSpan(span, start, end, 0);
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(
span, ANIMATED_COLOR_SPAN_FLOAT_PROPERTY, 0, 100);
objectAnimator.setEvaluator(new FloatEvaluator());
objectAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
textView.setText(spannableString);
}
});
objectAnimator.setInterpolator(new LinearInterpolator());
objectAnimator.setDuration(DateUtils.MINUTE_IN_MILLIS * 3);
objectAnimator.setRepeatCount(ValueAnimator.INFINITE);
objectAnimator.start();
}
代码示例来源:origin: Y-bao/PullRefreshView
public static Animator startRotation(View view, float toRotation, long duration, long startDelay, int times) {
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(view, "rotation", ViewHelper.getRotation(view), toRotation).setDuration(duration);
objectAnimator.setStartDelay(startDelay);
objectAnimator.setRepeatCount(times);
objectAnimator.setInterpolator(new LinearInterpolator());
objectAnimator.start();
return objectAnimator;
}
代码示例来源:origin: SMSTicket/sms-ticket
ViewCompat.setHasTransientState(view, false);
} else {
animator.setRepeatCount(ObjectAnimator.INFINITE);
animator.setDuration(1300);
animator.setInterpolator(new LinearInterpolator());
代码示例来源:origin: agxxxx/AIDLMusicPlayer
private void startDiscAnimator(float animatedValue) {
mDiscLayoutAnimator = ObjectAnimator.ofFloat(mDiscLayout, "rotation", animatedValue, 360 + animatedValue);
mDiscLayoutAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator arg0) {
mDiscLayoutAnimatorValue = (Float) arg0.getAnimatedValue();
}
});
mDiscLayoutAnimator.setDuration(DISC_ANIMATOR_TIME);
mDiscLayoutAnimator.setRepeatCount(DISC_ANIMATOR_REPEAT_COUNT);
mDiscLayoutAnimator.setInterpolator(new LinearInterpolator());
if (mDiscLayoutAnimator.isRunning() || mDiscLayoutAnimator.isStarted()) {
mDiscLayoutAnimator.cancel();
}
mDiscLayoutAnimator.start();
}
代码示例来源:origin: chiemy/LoadingImageView
private void initAnim() {
stopAnim();
//animator = ObjectAnimator.ofInt(this, "maskHeight", 0, imageHeight);
animator = ObjectAnimator.ofInt(clipDrawable, "level", 0, 10000);
animator.setDuration(animDuration);
animator.setRepeatCount(ValueAnimator.INFINITE);
animator.setRepeatMode(ValueAnimator.RESTART);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
invalidate();
}
});
if(autoStart){
animator.start();
}
}
代码示例来源:origin: NEYouFan/ht-refreshrecyclerview
@Override
public void onRefreshing() {
mRefreshLoadView.setPivotX(0.5f * mRefreshLoadView.getMeasuredWidth());
mRefreshLoadView.setPivotY(0.5f * mRefreshLoadView.getMeasuredHeight());
if (animator == null) {
animator = ObjectAnimator.ofFloat(mRefreshLoadView, "rotation", 0.0f, 360.0f);
animator.setDuration(1000);
animator.setRepeatCount(ValueAnimator.INFINITE);
animator.setRepeatMode(ValueAnimator.RESTART);
}
if (animator.isRunning()) animator.cancel();
animator.start();
}
代码示例来源:origin: NEYouFan/ht-refreshrecyclerview
@Override
public void onRefreshing() {
mRefreshLoadView.setPivotX(0.5f * mRefreshLoadView.getMeasuredWidth());
mRefreshLoadView.setPivotY(0.5f * mRefreshLoadView.getMeasuredHeight());
if (animator == null) {
animator = ObjectAnimator.ofFloat(mRefreshLoadView, "rotation", 0.0f, 360.0f);
animator.setDuration(1000);
animator.setRepeatCount(ValueAnimator.INFINITE);
animator.setRepeatMode(ValueAnimator.RESTART);
}
if (animator.isRunning()) animator.cancel();
animator.start();
}
代码示例来源:origin: NEYouFan/ht-refreshrecyclerview
@Override
public void onRefreshing() {
mRefreshLoadView.setPivotX(0.5f * mRefreshLoadView.getMeasuredWidth());
mRefreshLoadView.setPivotY(0.5f * mRefreshLoadView.getMeasuredHeight());
if (animator == null) {
animator = ObjectAnimator.ofFloat(mRefreshLoadView, "rotation", 0.0f, 360.0f);
animator.setDuration(1000);
animator.setRepeatCount(ValueAnimator.INFINITE);
animator.setRepeatMode(ValueAnimator.RESTART);
}
if (animator.isRunning()) animator.cancel();
animator.start();
}
代码示例来源:origin: NEYouFan/ht-refreshrecyclerview
@Override
public void onRefreshing() {
mRefreshLoadView.setPivotX(0.5f * mRefreshLoadView.getMeasuredWidth());
mRefreshLoadView.setPivotY(0.5f * mRefreshLoadView.getMeasuredHeight());
if (animator == null) {
animator = ObjectAnimator.ofFloat(mRefreshLoadView, "rotation", 0.0f, 360.0f);
animator.setDuration(1000);
animator.setRepeatCount(ValueAnimator.INFINITE);
animator.setRepeatMode(ValueAnimator.RESTART);
}
if (animator.isRunning()) animator.cancel();
animator.start();
}
内容来源于网络,如有侵权,请联系作者删除!