Code example for ViewFlipper

Methods: setInAnimationsetOutAnimationshowPrevious

0
            float dx = Math.abs(velocityX); 
            float dy = Math.abs(velocityY); 
 
            if (dx > dy && dx > 150) { 
                if (e1.getX() < e2.getX()) { 
                    viewFlipper.setInAnimation(inFromLeft); 
                    viewFlipper.setOutAnimation(outToRight); 
                    viewFlipper.showPrevious(); 
                    setDataLogic.leftToRightLogic(); 
                } else { 
                    viewFlipper.setInAnimation(inFromRight); 
                    viewFlipper.setOutAnimation(outToLeft); 
                    viewFlipper.showNext(); 
                    setDataLogic.rightToLeftLogic(); 
                } 
                setDataLogic.setDataLogic(); 
                Log.d("BBT", "OnGestureListener.onFling"); 
                return true; 
            } 
 
            return false;