Code example for ViewFlipper

Methods: setInAnimationsetOutAnimationshowNextshowPrevious

0
                float currentX = arg1.getX();            
 
                // going backwards: pushing stuff to the right 
                if (downXValue < currentX) {
                	// Get a reference to the ViewFlipper 
                	viewFlipper.setInAnimation(myFlipperAnimation.inFromRightAnimation());
                	viewFlipper.setOutAnimation(myFlipperAnimation.outToLeftAnimation());
                	viewFlipper.showNext();
                	/* 
                	Intent myIntent = new Intent(v.getContext(), VolsActivity.class); 
                    startActivityForResult(myIntent, 0); 
                    */ 
                } 
 
                // going forwards: pushing stuff to the left 
                if (downXValue > currentX) {
                	viewFlipper.setInAnimation(myFlipperAnimation.inFromLeftAnimation());
                	viewFlipper.setOutAnimation(myFlipperAnimation.outToRightAnimation());
                	viewFlipper.showPrevious();  
                	/* 
                	Intent myIntent = new Intent(v.getContext(), MeteoActivity.class); 
                    startActivityForResult(myIntent, 0); 
                    */ 
                }