use of android.view.animation.LinearInterpolator in project AVLoadingIndicatorView by 81813780.
the class PacmanIndicator method onCreateAnimators.
@Override
public ArrayList<ValueAnimator> onCreateAnimators() {
ArrayList<ValueAnimator> animators = new ArrayList<>();
float startT = getWidth() / 11;
ValueAnimator translationAnim = ValueAnimator.ofFloat(getWidth() - startT, getWidth() / 2);
translationAnim.setDuration(650);
translationAnim.setInterpolator(new LinearInterpolator());
translationAnim.setRepeatCount(-1);
addUpdateListener(translationAnim, new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
translateX = (float) animation.getAnimatedValue();
postInvalidate();
}
});
ValueAnimator alphaAnim = ValueAnimator.ofInt(255, 122);
alphaAnim.setDuration(650);
alphaAnim.setRepeatCount(-1);
addUpdateListener(alphaAnim, new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
alpha = (int) animation.getAnimatedValue();
postInvalidate();
}
});
ValueAnimator rotateAnim1 = ValueAnimator.ofFloat(0, 45, 0);
rotateAnim1.setDuration(650);
rotateAnim1.setRepeatCount(-1);
addUpdateListener(rotateAnim1, new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
degrees1 = (float) animation.getAnimatedValue();
postInvalidate();
}
});
ValueAnimator rotateAnim2 = ValueAnimator.ofFloat(0, -45, 0);
rotateAnim2.setDuration(650);
rotateAnim2.setRepeatCount(-1);
addUpdateListener(rotateAnim2, new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
degrees2 = (float) animation.getAnimatedValue();
postInvalidate();
}
});
animators.add(translationAnim);
animators.add(alphaAnim);
animators.add(rotateAnim1);
animators.add(rotateAnim2);
return animators;
}
use of android.view.animation.LinearInterpolator in project AVLoadingIndicatorView by 81813780.
the class SquareSpinIndicator method onCreateAnimators.
@Override
public ArrayList<ValueAnimator> onCreateAnimators() {
ArrayList<ValueAnimator> animators = new ArrayList<>();
ValueAnimator animator = ValueAnimator.ofFloat(0, 180, 180, 0, 0);
addUpdateListener(animator, new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
rotateX = (float) animation.getAnimatedValue();
postInvalidate();
}
});
animator.setInterpolator(new LinearInterpolator());
animator.setRepeatCount(-1);
animator.setDuration(2500);
ValueAnimator animator1 = ValueAnimator.ofFloat(0, 0, 180, 180, 0);
addUpdateListener(animator1, new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
rotateY = (float) animation.getAnimatedValue();
postInvalidate();
}
});
animator1.setInterpolator(new LinearInterpolator());
animator1.setRepeatCount(-1);
animator1.setDuration(2500);
animators.add(animator);
animators.add(animator1);
return animators;
}
use of android.view.animation.LinearInterpolator in project AVLoadingIndicatorView by 81813780.
the class BallPulseRiseIndicator method onCreateAnimators.
@Override
public ArrayList<ValueAnimator> onCreateAnimators() {
ArrayList<ValueAnimator> animators = new ArrayList<>();
ValueAnimator animator = ValueAnimator.ofFloat(0, 360);
addUpdateListener(animator, new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
degress = (float) animation.getAnimatedValue();
postInvalidate();
}
});
animator.setInterpolator(new LinearInterpolator());
animator.setRepeatCount(-1);
animator.setDuration(1500);
animators.add(animator);
return animators;
}
use of android.view.animation.LinearInterpolator in project AVLoadingIndicatorView by 81813780.
the class BallScaleRippleIndicator method onCreateAnimators.
@Override
public ArrayList<ValueAnimator> onCreateAnimators() {
ArrayList<ValueAnimator> animators = new ArrayList<>();
ValueAnimator scaleAnim = ValueAnimator.ofFloat(0, 1);
scaleAnim.setInterpolator(new LinearInterpolator());
scaleAnim.setDuration(1000);
scaleAnim.setRepeatCount(-1);
addUpdateListener(scaleAnim, new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
scale = (float) animation.getAnimatedValue();
postInvalidate();
}
});
ValueAnimator alphaAnim = ValueAnimator.ofInt(0, 255);
alphaAnim.setInterpolator(new LinearInterpolator());
alphaAnim.setDuration(1000);
alphaAnim.setRepeatCount(-1);
addUpdateListener(alphaAnim, new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
alpha = (int) animation.getAnimatedValue();
postInvalidate();
}
});
animators.add(scaleAnim);
animators.add(alphaAnim);
return animators;
}
use of android.view.animation.LinearInterpolator in project AVLoadingIndicatorView by 81813780.
the class BallTrianglePathIndicator method onCreateAnimators.
@Override
public ArrayList<ValueAnimator> onCreateAnimators() {
ArrayList<ValueAnimator> animators = new ArrayList<>();
float startX = getWidth() / 5;
float startY = getWidth() / 5;
for (int i = 0; i < 3; i++) {
final int index = i;
ValueAnimator translateXAnim = ValueAnimator.ofFloat(getWidth() / 2, getWidth() - startX, startX, getWidth() / 2);
if (i == 1) {
translateXAnim = ValueAnimator.ofFloat(getWidth() - startX, startX, getWidth() / 2, getWidth() - startX);
} else if (i == 2) {
translateXAnim = ValueAnimator.ofFloat(startX, getWidth() / 2, getWidth() - startX, startX);
}
ValueAnimator translateYAnim = ValueAnimator.ofFloat(startY, getHeight() - startY, getHeight() - startY, startY);
if (i == 1) {
translateYAnim = ValueAnimator.ofFloat(getHeight() - startY, getHeight() - startY, startY, getHeight() - startY);
} else if (i == 2) {
translateYAnim = ValueAnimator.ofFloat(getHeight() - startY, startY, getHeight() - startY, getHeight() - startY);
}
translateXAnim.setDuration(2000);
translateXAnim.setInterpolator(new LinearInterpolator());
translateXAnim.setRepeatCount(-1);
addUpdateListener(translateXAnim, new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
translateX[index] = (float) animation.getAnimatedValue();
postInvalidate();
}
});
translateYAnim.setDuration(2000);
translateYAnim.setInterpolator(new LinearInterpolator());
translateYAnim.setRepeatCount(-1);
addUpdateListener(translateYAnim, new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
translateY[index] = (float) animation.getAnimatedValue();
postInvalidate();
}
});
animators.add(translateXAnim);
animators.add(translateYAnim);
}
return animators;
}
Aggregations