use of com.nineoldandroids.animation.ValueAnimator in project ListViewAnimations by nhaarman.
the class SwipeDismissTouchListener method performDismiss.
/**
* Animates the dismissed list item to zero-height and fires the dismiss callback when all dismissed list item animations have completed.
*
* @param view the dismissed {@link android.view.View}.
*/
protected void performDismiss(@NonNull final View view, final int position) {
mDismissedViews.add(view);
mDismissedPositions.add(position);
ValueAnimator animator = ValueAnimator.ofInt(view.getHeight(), 1).setDuration(mDismissAnimationTime);
animator.addUpdateListener(new DismissAnimatorUpdateListener(view));
animator.addListener(new DismissAnimatorListener());
animator.start();
mActiveDismissCount++;
}
use of com.nineoldandroids.animation.ValueAnimator in project MinimalForm by sd6352051.
the class MinimalFormLayout method animPrevious.
private void animPrevious() {
ValueAnimator valueAnimator = ValueAnimator.ofInt(currentnumber, currentStep * progressnumber);
valueAnimator.setDuration(ANIMATION_DURATION);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
mProgressBar.setProgress((Integer) valueAnimator.getAnimatedValue());
}
});
valueAnimator.start();
}
use of com.nineoldandroids.animation.ValueAnimator in project MinimalForm by sd6352051.
the class MinimalFormLayout method animNext.
private void animNext() {
ValueAnimator valueAnimator = ValueAnimator.ofInt(currentnumber, currentStep * progressnumber);
valueAnimator.setDuration(ANIMATION_DURATION);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
int i = (Integer) valueAnimator.getAnimatedValue();
if (i == datasize * progressnumber) {
success();
} else {
mProgressBar.setProgress(i);
}
}
});
valueAnimator.start();
}
use of com.nineoldandroids.animation.ValueAnimator in project FlowingDrawer by mxn21.
the class ElasticDrawer method flowDown.
private void flowDown(final int finalX) {
ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, 1);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
mMenuView.setUpDownFraction(animation.getAnimatedFraction());
}
});
valueAnimator.addListener(new FlowingAnimationListener() {
@Override
public void onAnimationEnd(Animator animation) {
if (mDrawerState == STATE_OPENING) {
mMenuVisible = finalX != 0;
setOffsetPixels(finalX, 0, FlowingMenuLayout.TYPE_NONE);
setDrawerState(finalX == 0 ? STATE_CLOSED : STATE_OPEN);
stopLayerTranslation();
}
}
});
valueAnimator.setDuration(300);
valueAnimator.setInterpolator(new OvershootInterpolator(4f));
valueAnimator.start();
}
use of com.nineoldandroids.animation.ValueAnimator in project FlowingDrawer by mxn21.
the class ElasticDrawer method smoothClose.
protected void smoothClose(final int eventY) {
endDrag();
setDrawerState(STATE_CLOSING);
ValueAnimator valueAnimator = ValueAnimator.ofFloat(mOffsetPixels, 0);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
setOffsetPixels((Float) animation.getAnimatedValue(), eventY, FlowingMenuLayout.TYPE_DOWN_SMOOTH);
}
});
valueAnimator.addListener(new FlowingAnimationListener() {
@Override
public void onAnimationEnd(Animator animation) {
mMenuVisible = false;
setOffsetPixels(0, 0, FlowingMenuLayout.TYPE_NONE);
setDrawerState(STATE_CLOSED);
stopLayerTranslation();
}
});
valueAnimator.setDuration(500);
valueAnimator.setInterpolator(new DecelerateInterpolator(4f));
valueAnimator.start();
}
Aggregations