use of com.nineoldandroids.animation.Animator in project PersistentSearch by KieronQuinn.
the class MaterialMenuDrawable method initAnimations.
private void initAnimations(int transformDuration, int pressedDuration) {
transformation = ObjectAnimator.ofFloat(this, transformationProperty, 0);
transformation.setInterpolator(new DecelerateInterpolator(3));
transformation.setDuration(transformDuration);
transformation.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
transformationRunning = false;
setIconState(animatingIconState);
}
});
pressedCircle = ObjectAnimator.ofFloat(this, pressedProgressProperty, 0, 0);
pressedCircle.setDuration(pressedDuration);
pressedCircle.setInterpolator(new DecelerateInterpolator());
pressedCircle.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
pressedProgressValue = 0;
}
@Override
public void onAnimationCancel(Animator animation) {
pressedProgressValue = 0;
}
});
}
use of com.nineoldandroids.animation.Animator in project PersistentSearch by KieronQuinn.
the class SupportAnimatorPreL method addListener.
@Override
public void addListener(final AnimatorListener listener) {
Animator a = mSupportFramework.get();
if (a == null) {
return;
}
if (listener == null) {
a.addListener(null);
return;
}
a.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
listener.onAnimationStart();
}
@Override
public void onAnimationEnd(Animator animation) {
listener.onAnimationEnd();
}
@Override
public void onAnimationCancel(Animator animation) {
listener.onAnimationCancel();
}
@Override
public void onAnimationRepeat(Animator animation) {
listener.onAnimationRepeat();
}
});
}
use of com.nineoldandroids.animation.Animator in project ListViewAnimations by nhaarman.
the class ViewAnimator method cancelExistingAnimation.
/**
* Cancels any existing animations for given View.
*/
void cancelExistingAnimation(@NonNull final View view) {
int hashCode = view.hashCode();
Animator animator = mAnimators.get(hashCode);
if (animator != null) {
animator.end();
mAnimators.remove(hashCode);
}
}
use of com.nineoldandroids.animation.Animator in project ListViewAnimations by nhaarman.
the class AnimatorUtil method concatAnimators.
/**
* Merges given Animators into one array.
*/
@NonNull
public static Animator[] concatAnimators(@NonNull final Animator[] childAnimators, @NonNull final Animator[] animators, @NonNull final Animator alphaAnimator) {
Animator[] allAnimators = new Animator[childAnimators.length + animators.length + 1];
int i;
for (i = 0; i < childAnimators.length; ++i) {
allAnimators[i] = childAnimators[i];
}
for (Animator animator : animators) {
allAnimators[i] = animator;
++i;
}
allAnimators[allAnimators.length - 1] = alphaAnimator;
return allAnimators;
}
use of com.nineoldandroids.animation.Animator in project AdvancedMaterialDrawer by madcyph3r.
the class MaterialRippleLayoutNineOld method startRipple.
private void startRipple(final Runnable animationEndRunnable) {
if (eventCancelled)
return;
float endRadius = getEndRadius();
cancelAnimations();
rippleAnimator = new AnimatorSet();
rippleAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (!ripplePersistent) {
setRadius(0);
setRippleAlpha(rippleAlpha);
}
if (animationEndRunnable != null && rippleDelayClick) {
animationEndRunnable.run();
}
childView.setPressed(false);
}
});
ObjectAnimator ripple = ObjectAnimator.ofFloat(this, radiusProperty, radius, endRadius);
ripple.setDuration(rippleDuration);
ripple.setInterpolator(new DecelerateInterpolator());
ObjectAnimator fade = ObjectAnimator.ofInt(this, circleAlphaProperty, rippleAlpha, 0);
fade.setDuration(rippleFadeDuration);
fade.setInterpolator(new AccelerateInterpolator());
fade.setStartDelay(rippleDuration - rippleFadeDuration - FADE_EXTRA_DELAY);
if (ripplePersistent) {
rippleAnimator.play(ripple);
} else if (getRadius() > endRadius) {
fade.setStartDelay(0);
rippleAnimator.play(fade);
} else {
rippleAnimator.playTogether(ripple, fade);
}
rippleAnimator.start();
}
Aggregations