Example usage for android.support.v4.view ViewPropertyAnimatorCompat rotationXBy

List of usage examples for android.support.v4.view ViewPropertyAnimatorCompat rotationXBy

Introduction

In this page you can find the example usage for android.support.v4.view ViewPropertyAnimatorCompat rotationXBy.

Prototype

public ViewPropertyAnimatorCompat rotationXBy(float f) 

Source Link

Usage

From source file:com.twotoasters.jazzylistview.effects.FlipEffect.java

@Override
public void setupAnimation(View item, int position, int scrollDirection, ViewPropertyAnimatorCompat animator) {
    animator.rotationXBy(INITIAL_ROTATION_ANGLE * scrollDirection);
}

From source file:com.twotoasters.jazzylistview.effects.FlyEffect.java

@Override
public void setupAnimation(View item, int position, int scrollDirection, ViewPropertyAnimatorCompat animator) {
    animator.rotationXBy(INITIAL_ROTATION_ANGLE * scrollDirection)
            .translationYBy(-item.getHeight() * 2 * scrollDirection);
}

From source file:com.twotoasters.jazzylistview.effects.ReverseFlyEffect.java

@Override
public void setupAnimation(View item, int position, int scrollDirection, ViewPropertyAnimatorCompat animator) {
    animator.rotationXBy(-INITIAL_ROTATION_ANGLE * scrollDirection)
            .translationYBy(item.getHeight() * 2 * scrollDirection);
}

From source file:com.twotoasters.jazzylistview.effects.TwirlEffect.java

@Override
public void setupAnimation(View item, int position, int scrollDirection, ViewPropertyAnimatorCompat animator) {
    animator.rotationXBy(-INITIAL_ROTATION_X).rotationYBy(-INITIAL_ROTATION_Y * scrollDirection)
            .rotationBy(-INITIAL_ROTATION_Z);
}

From source file:com.cs.test_recycview3.MyAnimator.java

void animateMoveImpl(final ViewHolder holder, int fromX, int fromY, int toX, int toY) {
    final View view = holder.itemView;
    final int deltaX = toX - fromX;
    final int deltaY = toY - fromY;
    if (deltaX != 0) {
        ViewCompat.animate(view).translationX(0);
    }//from  w  w  w . ja  v  a  2 s . co m
    if (deltaY != 0) {
        ViewCompat.animate(view).translationY(0);
    }
    // TODO: make EndActions end listeners instead, since end actions aren't called when
    // vpas are canceled (and can't end them. why?)
    // need listener functionality in VPACompat for this. Ick.
    final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view);
    animation.rotationXBy(360);
    mMoveAnimations.add(holder);
    animation.setDuration(getMoveDuration()).setListener(new VpaListenerAdapter() {
        @Override
        public void onAnimationStart(View view) {
            dispatchMoveStarting(holder);
        }

        @Override
        public void onAnimationCancel(View view) {
            if (deltaX != 0) {
                ViewCompat.setTranslationX(view, 0);
            }
            if (deltaY != 0) {
                ViewCompat.setTranslationY(view, 0);
            }
        }

        @Override
        public void onAnimationEnd(View view) {
            animation.setListener(null);
            dispatchMoveFinished(holder);
            mMoveAnimations.remove(holder);
            dispatchFinishedWhenDone();
        }
    }).start();
}

From source file:com.huihui.android_recyclerview.MyItemAnimator.java

private void animateAddImpl(final ViewHolder holder) {
    final View view = holder.itemView;
    final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view);
    mAddAnimations.add(holder);/*w w  w  . j  a va 2 s .  c  om*/
    animation.rotationXBy(720).translationX(0).setDuration(getAddDuration())
            .setListener(new VpaListenerAdapter() {
                @Override
                public void onAnimationStart(View view) {
                    dispatchAddStarting(holder);
                }

                @Override
                public void onAnimationCancel(View view) {
                    ViewCompat.setTranslationX(view, 0);
                }

                @Override
                public void onAnimationEnd(View view) {
                    animation.setListener(null);
                    dispatchAddFinished(holder);
                    mAddAnimations.remove(holder);
                    dispatchFinishedWhenDone();
                }
            }).start();
}

From source file:practice.gaolei.textrecyclerview.MyItemAnimator.java

void animateMoveImpl(final ViewHolder holder, int fromX, int fromY, int toX, int toY) {
    final View view = holder.itemView;
    final int deltaX = toX - fromX;
    final int deltaY = toY - fromY;
    if (deltaX != 0) {
        ViewCompat.animate(view).translationX(0);
    }//from   www.  j av  a 2  s  . c  o  m
    if (deltaY != 0) {
        ViewCompat.animate(view).translationY(0);
    }
    // TODO: make EndActions end listeners instead, since end actions aren't called when
    // vpas are canceled (and can't end them. why?)
    // need listener functionality in VPACompat for this. Ick.
    final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view);
    animation.rotationXBy(360);//x360
    mMoveAnimations.add(holder);
    animation.setDuration(getMoveDuration()).setListener(new VpaListenerAdapter() {
        @Override
        public void onAnimationStart(View view) {
            dispatchMoveStarting(holder);
        }

        @Override
        public void onAnimationCancel(View view) {
            if (deltaX != 0) {
                ViewCompat.setTranslationX(view, 0);
            }
            if (deltaY != 0) {
                ViewCompat.setTranslationY(view, 0);
            }
        }

        @Override
        public void onAnimationEnd(View view) {
            animation.setListener(null);
            dispatchMoveFinished(holder);
            mMoveAnimations.remove(holder);
            dispatchFinishedWhenDone();
        }
    }).start();
}

From source file:com.chenli.recycler.MyItemAnimator.java

void animateMoveImpl(final ViewHolder holder, int fromX, int fromY, int toX, int toY) {
    final View view = holder.itemView;
    final int deltaX = toX - fromX;
    final int deltaY = toY - fromY;
    if (deltaX != 0) {
        ViewCompat.animate(view).translationX(0);
    }/*from  w ww. j  av a2 s. co  m*/
    if (deltaY != 0) {
        ViewCompat.animate(view).translationY(0);
    }
    // TODO: make EndActions end listeners instead, since end actions aren't called when
    // vpas are canceled (and can't end them. why?)
    // need listener functionality in VPACompat for this. Ick.
    final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view);
    animation.rotationXBy(360);//
    mMoveAnimations.add(holder);
    animation.setDuration(getMoveDuration()).setListener(new VpaListenerAdapter() {
        @Override
        public void onAnimationStart(View view) {
            dispatchMoveStarting(holder);
        }

        @Override
        public void onAnimationCancel(View view) {
            if (deltaX != 0) {
                ViewCompat.setTranslationX(view, 0);
            }
            if (deltaY != 0) {
                ViewCompat.setTranslationY(view, 0);
            }
        }

        @Override
        public void onAnimationEnd(View view) {
            animation.setListener(null);
            dispatchMoveFinished(holder);
            mMoveAnimations.remove(holder);
            dispatchFinishedWhenDone();
        }
    }).start();
}

From source file:com.example.lining.mydemo.animator.MyItemAnimator.java

void animateMoveImpl(final ViewHolder holder, int fromX, int fromY, int toX, int toY) {
    final View view = holder.itemView;
    final int deltaX = toX - fromX;
    final int deltaY = toY - fromY;
    if (deltaX != 0) {
        ViewCompat.animate(view).translationX(0);
    }/* w ww .  jav a 2 s.  c o  m*/
    if (deltaY != 0) {
        ViewCompat.animate(view).translationY(0);
    }
    // TODO: make EndActions end listeners instead, since end actions aren't called when
    // vpas are canceled (and can't end them. why?)
    // need listener functionality in VPACompat for this. Ick.
    final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view);
    animation.rotationXBy(180);
    mMoveAnimations.add(holder);
    animation.setDuration(getMoveDuration()).setListener(new VpaListenerAdapter() {
        @Override
        public void onAnimationStart(View view) {
            dispatchMoveStarting(holder);
        }

        @Override
        public void onAnimationCancel(View view) {
            if (deltaX != 0) {
                ViewCompat.setTranslationX(view, 0);
            }
            if (deltaY != 0) {
                ViewCompat.setTranslationY(view, 0);
            }
        }

        @Override
        public void onAnimationEnd(View view) {
            animation.setListener(null);
            ViewCompat.setRotationX(view, 0);
            dispatchMoveFinished(holder);
            mMoveAnimations.remove(holder);
            dispatchFinishedWhenDone();
        }
    }).start();
}