Search in sources :

Example 6 with ObjectAnimator

use of com.marshalchen.common.uimodule.nineoldandroids.animation.ObjectAnimator in project UltimateAndroid by cymcsg.

the class ContextualUndoAdapter method swipeView.

private void swipeView(final View view, final int dismissPosition) {
    ObjectAnimator animator = ObjectAnimator.ofFloat(view, X, view.getMeasuredWidth());
    animator.addListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationEnd(final Animator animator) {
            onViewSwiped(((ContextualUndoView) view).getItemId(), dismissPosition);
        }
    });
    animator.start();
}
Also used : ValueAnimator(com.marshalchen.common.uimodule.nineoldandroids.animation.ValueAnimator) ObjectAnimator(com.marshalchen.common.uimodule.nineoldandroids.animation.ObjectAnimator) Animator(com.marshalchen.common.uimodule.nineoldandroids.animation.Animator) ObjectAnimator(com.marshalchen.common.uimodule.nineoldandroids.animation.ObjectAnimator) AnimatorListenerAdapter(com.marshalchen.common.uimodule.nineoldandroids.animation.AnimatorListenerAdapter)

Example 7 with ObjectAnimator

use of com.marshalchen.common.uimodule.nineoldandroids.animation.ObjectAnimator in project UltimateAndroid by cymcsg.

the class FilckerAnimationListView method animateY.

protected ObjectAnimator animateY(final View view, final float oldY, final float newY, final float durationUnit) {
    final int duration = getDuration(oldY, newY, durationUnit);
    final ObjectAnimator anim = ObjectAnimator.ofFloat(AnimatorProxy.wrap(view), "translationY", oldY - newY, 0);
    final int finalDuration = Math.min(Math.max(duration, MIN_ANIM_DURATION), MAX_ANIM_DURATION);
    anim.setDuration((long) (finalDuration * animationDurationFactor));
    anim.setInterpolator(translateInterpolater);
    return anim;
}
Also used : ObjectAnimator(com.marshalchen.common.uimodule.nineoldandroids.animation.ObjectAnimator)

Aggregations

ObjectAnimator (com.marshalchen.common.uimodule.nineoldandroids.animation.ObjectAnimator)7 Animator (com.marshalchen.common.uimodule.nineoldandroids.animation.Animator)4 AnimatorListenerAdapter (com.marshalchen.common.uimodule.nineoldandroids.animation.AnimatorListenerAdapter)3 AnimatorSet (com.marshalchen.common.uimodule.nineoldandroids.animation.AnimatorSet)3 View (android.view.View)2 ListView (android.widget.ListView)2 ValueAnimator (com.marshalchen.common.uimodule.nineoldandroids.animation.ValueAnimator)2 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)1 LinearInterpolator (android.view.animation.LinearInterpolator)1 AnimatorProxy (com.marshalchen.common.uimodule.nineoldandroids.view.animation.AnimatorProxy)1 Entry (java.util.Map.Entry)1