use of android.view.animation.LinearInterpolator in project UltimateAndroid by cymcsg.
the class CreditScrollDemoActivity method animateScroll.
private void animateScroll() {
mScrolling = true;
mScrollAnimator = ObjectAnimator.ofInt(mSeekBar, "progress", mSeekBar.getProgress(), mSeekBar.getMax());
mScrollAnimator.setDuration((long) (SCROLL_ANIM_DURATION * (1 - (float) mSeekBar.getProgress() / mSeekBar.getMax())));
mScrollAnimator.setInterpolator(new LinearInterpolator());
mScrollAnimator.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
// Don't care
}
@Override
public void onAnimationEnd(Animator animation) {
mScrolling = false;
}
@Override
public void onAnimationCancel(Animator animation) {
// Don't care
}
@Override
public void onAnimationRepeat(Animator animation) {
// Don't care
}
});
mScrollAnimator.start();
}
use of android.view.animation.LinearInterpolator in project SmoothProgressBar by castorflex.
the class MakeCustomActivity method setInterpolator.
private void setInterpolator(int position) {
switch(position) {
case 1:
mCurrentInterpolator = new LinearInterpolator();
mSeekBarFactor.setEnabled(false);
break;
case 2:
mCurrentInterpolator = new AccelerateDecelerateInterpolator();
mSeekBarFactor.setEnabled(false);
break;
case 3:
mCurrentInterpolator = new DecelerateInterpolator(mFactor);
mSeekBarFactor.setEnabled(true);
break;
case 4:
mCurrentInterpolator = new FastOutSlowInInterpolator();
mSeekBarFactor.setEnabled(true);
break;
case 0:
default:
mCurrentInterpolator = new AccelerateInterpolator(mFactor);
mSeekBarFactor.setEnabled(true);
break;
}
mProgressBar.setSmoothProgressDrawableInterpolator(mCurrentInterpolator);
mProgressBar.setSmoothProgressDrawableColors(getResources().getIntArray(R.array.gplus_colors));
updateValues();
}
use of android.view.animation.LinearInterpolator in project cw-omnibus by commonsguy.
the class IcsProgressBar method startAnimation.
/**
* <p>Start the indeterminate progress animation.</p>
*/
void startAnimation() {
if (getVisibility() != VISIBLE) {
return;
}
if (mIndeterminateDrawable instanceof Animatable) {
mShouldStartAnimationDrawable = true;
mAnimation = null;
} else {
if (mInterpolator == null) {
mInterpolator = new LinearInterpolator();
}
mTransformation = new Transformation();
mAnimation = new AlphaAnimation(0.0f, 1.0f);
mAnimation.setRepeatMode(mBehavior);
mAnimation.setRepeatCount(Animation.INFINITE);
mAnimation.setDuration(mDuration);
mAnimation.setInterpolator(mInterpolator);
mAnimation.setStartTime(Animation.START_ON_FIRST_FRAME);
}
postInvalidate();
}
use of android.view.animation.LinearInterpolator in project ENViews by codeestX.
the class ENDownloadView method downloadAnim.
private void downloadAnim() {
ValueAnimator downloadAnim = ValueAnimator.ofFloat(1.f, 100.f);
downloadAnim.setDuration(mDownloadTime);
downloadAnim.setInterpolator(new LinearInterpolator());
downloadAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
mFraction = valueAnimator.getAnimatedFraction();
if (mUnit != DownloadUnit.NONE && mTotalSize > 0)
mCurrentSize = mFraction * mTotalSize;
invalidate();
}
});
downloadAnim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mCurrentState = STATE_END;
endAnim();
}
});
downloadAnim.start();
}
use of android.view.animation.LinearInterpolator in project ENViews by codeestX.
the class ENSearchView method start.
public void start() {
if (mCurrentState == STATE_SEARCHING) {
return;
}
mCurrentState = STATE_SEARCHING;
ValueAnimator valueAnim = ValueAnimator.ofFloat(1.f, 100.f);
valueAnim.setDuration(mDuration);
valueAnim.setInterpolator(new LinearInterpolator());
valueAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
mFraction = valueAnimator.getAnimatedFraction();
invalidate();
}
});
valueAnim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mCurrentState = STATE_WAIT;
}
});
valueAnim.start();
}
Aggregations