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 smartmodule by carozhu.
the class ToggleExpandLayout method close.
public void close() {
if (isOpen) {
isOpen = false;
for (OnToggleTouchListener l : listeners) {
l.onStartClose(expandHeight, originalHeight);
}
int childCount = getChildCount();
for (int i = 0; i < childCount - 1; i++) {
View child = getChildAt(i);
View preChild = getChildAt(i + 1);
CloseViewAnimator animator = new CloseViewAnimator(mPosY, mTop, i);
animator.animate(child);
Log.e("animate open", "invoked");
if (i == 0) {
animator.addAnimatorListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
for (int i = 0; i < getChildCount() - 1; i++) {
View child = getChildAt(i);
child.setVisibility(INVISIBLE);
}
for (OnToggleTouchListener l : listeners) {
l.onClosed();
}
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
}
mPosY = mPosY - preChild.getMeasuredHeight();
}
}
}
use of com.nineoldandroids.animation.Animator in project smartmodule by carozhu.
the class ToggleExpandLayout method open.
public void open() {
if (!isOpen) {
isOpen = true;
for (int i = 0; i < getChildCount() - 1; i++) {
View child = getChildAt(i);
child.setVisibility(VISIBLE);
}
mPosY = 0;
for (OnToggleTouchListener l : listeners) {
l.onStartOpen(expandHeight, originalHeight);
}
int childCount = getChildCount();
for (int i = childCount - 2; i > -1; i--) {
View child = getChildAt(i);
View preChild = getChildAt(i + 1);
int preHeight = preChild.getMeasuredHeight();
OpenViewAnimator animator = new OpenViewAnimator(mTop, mPosY + preHeight, i);
animator.animate(child);
Log.e("animate open", "invoked");
if (i == 0) {
animator.addAnimatorListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
for (OnToggleTouchListener l : listeners) {
l.onOpen();
}
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
}
mPosY = mPosY + preHeight;
}
}
}
use of com.nineoldandroids.animation.Animator in project android-shapeLoadingView by zzz40500.
the class LoadingView method stopLoading.
private void stopLoading() {
mStopped = true;
if (mUpAnimatorSet != null) {
if (mUpAnimatorSet.isRunning()) {
mUpAnimatorSet.cancel();
}
mUpAnimatorSet.removeAllListeners();
for (Animator animator : mUpAnimatorSet.getChildAnimations()) {
animator.removeAllListeners();
}
mUpAnimatorSet = null;
}
if (mDownAnimatorSet != null) {
if (mDownAnimatorSet.isRunning()) {
mDownAnimatorSet.cancel();
}
mDownAnimatorSet.removeAllListeners();
for (Animator animator : mDownAnimatorSet.getChildAnimations()) {
animator.removeAllListeners();
}
mDownAnimatorSet = null;
}
this.removeCallbacks(mFreeFallRunnable);
}
Aggregations