animation/ViewAnimation.java
/**
     * * Slide view towards the <b>right</b> and fade out.
     * @param view view to animate
     * @param cb callback for animation complete
     */
Slide view towards the right and fade out.
@param view view to animate
@param cb callback for animation complete
Slide view towards the right and fade out . @param view view to animate @param cb callback for animation complete
static public void slideOutRight(final View view, final SimpleCallback cb){
        view.animate()
                .translationX(view.getWidth()/animateOffsetWidth)
                .translationY(0)
                .alpha(0.0f)
                .setDuration(animateDuration)
                .setListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationStart(Animator animation) {
                        super.onAnimationStart(animation);
                        setAnimationInProgress(true);
                    }
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        super.onAnimationEnd(animation);
                        view.setVisibility(View.GONE);
                        setAnimationInProgress(false);
                        cb.done();
                    }
                    @Override
                    public void onAnimationCancel(Animator animation) {
                        super.onAnimationCancel(animation);
                        setAnimationInProgress(false);
                        cb.done();
                    }
                    @Override
                    public void onAnimationPause(Animator animation) {
                        super.onAnimationPause(animation);
                        setAnimationInProgress(false);
                        cb.done();
                    }
                    @Override
                    public void onAnimationResume(Animator animation) {
                        super.onAnimationResume(animation);
                        setAnimationInProgress(true);
                        cb.done();
                    }
                });
    }
static public void slideOutRight ( final View view , final SimpleCallback cb ) { view . animate ( ) . translationX ( view . getWidth ( ) / animateOffsetWidth ) . translationY ( 0 ) . alpha ( 0.0f ) . setDuration ( animateDuration ) . setListener ( new AnimatorListenerAdapter ( ) { @ Override public void onAnimationStart ( Animator animation ) { super . onAnimationStart ( animation ) ; setAnimationInProgress ( true ) ; } @ Override public void onAnimationEnd ( Animator animation ) { super . onAnimationEnd ( animation ) ; view . setVisibility ( View . GONE ) ; setAnimationInProgress ( false ) ; cb . done ( ) ; } @ Override public void onAnimationCancel ( Animator animation ) { super . onAnimationCancel ( animation ) ; setAnimationInProgress ( false ) ; cb . done ( ) ; } @ Override public void onAnimationPause ( Animator animation ) { super . onAnimationPause ( animation ) ; setAnimationInProgress ( false ) ; cb . done ( ) ; } @ Override public void onAnimationResume ( Animator animation ) { super . onAnimationResume ( animation ) ; setAnimationInProgress ( true ) ; cb . done ( ) ; } } ) ; }
* Slide view towards the <b>right</b> and fade out.
* Slide view towards the <b > right< / b > and fade out .