use of com.nineoldandroids.animation.ValueAnimator.AnimatorUpdateListener in project Signal-Android by WhisperSystems.
the class TransferControlView method getWidthAnimator.
private Animator getWidthAnimator(final int from, final int to) {
final ValueAnimator anim = ValueAnimator.ofInt(from, to);
anim.addUpdateListener(new AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
final int val = (Integer) animation.getAnimatedValue();
final ViewGroup.LayoutParams layoutParams = getLayoutParams();
layoutParams.width = val;
setLayoutParams(layoutParams);
}
});
anim.setInterpolator(new FastOutSlowInInterpolator());
anim.setDuration(TRANSITION_MS);
return anim;
}
use of com.nineoldandroids.animation.ValueAnimator.AnimatorUpdateListener in project SimplifyReader by chentao0707.
the class PlayerDiscView method reverseDiscAnimator.
private void reverseDiscAnimator() {
mDiscLayoutAnimator = ObjectAnimator.ofFloat(mDiscLayout, "rotation", mDiscLayoutAnimatorValue, 360);
mDiscLayoutAnimator.addUpdateListener(new AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator arg0) {
mDiscLayoutAnimatorValue = (Float) arg0.getAnimatedValue();
}
});
mDiscLayoutAnimator.setDuration(DISC_REVERSE_ANIMATOR_TIME);
mDiscLayoutAnimator.setInterpolator(new AccelerateInterpolator());
if (mDiscLayoutAnimator.isRunning() || mDiscLayoutAnimator.isStarted()) {
mDiscLayoutAnimator.cancel();
}
mDiscLayoutAnimator.start();
}
use of com.nineoldandroids.animation.ValueAnimator.AnimatorUpdateListener in project Signal-Android by signalapp.
the class TransferControlView method getWidthAnimator.
private Animator getWidthAnimator(final int from, final int to) {
final ValueAnimator anim = ValueAnimator.ofInt(from, to);
anim.addUpdateListener(new AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
final int val = (Integer) animation.getAnimatedValue();
final ViewGroup.LayoutParams layoutParams = getLayoutParams();
layoutParams.width = val;
setLayoutParams(layoutParams);
}
});
anim.setInterpolator(new FastOutSlowInInterpolator());
anim.setDuration(TRANSITION_MS);
return anim;
}
use of com.nineoldandroids.animation.ValueAnimator.AnimatorUpdateListener in project SimplifyReader by chentao0707.
the class PlayerDiscView method startDiscAnimator.
private void startDiscAnimator(float animatedValue) {
mDiscLayoutAnimator = ObjectAnimator.ofFloat(mDiscLayout, "rotation", animatedValue, 360 + animatedValue);
mDiscLayoutAnimator.addUpdateListener(new 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();
}
Aggregations