Code example for ViewFlipper

Methods: setAutoStartstopFlipping

0
		} 
	} 
 
	@Override 
	public boolean onTouchEvent(MotionEvent event) {
		viewFlipper.stopFlipping();				// 点击事件后,停止自动播放
		viewFlipper.setAutoStart(false);	
		return gestureDetector.onTouchEvent(event); 		// 注册手势事件
	} 
 
	@Override 
	public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
		if (e2.getX() - e1.getX() > 120) {			 // 从左向右滑动(左进右出)
			Animation rInAnim = AnimationUtils.loadAnimation(mActivity, R.anim.push_right_in); 	// 向右滑动左侧进入的渐变效果(alpha  0.1 -> 1.0)
			Animation rOutAnim = AnimationUtils.loadAnimation(mActivity, R.anim.push_right_out); // 向右滑动右侧滑出的渐变效果(alpha 1.0  -> 0.1)
 
			viewFlipper.setInAnimation(rInAnim);
			viewFlipper.setOutAnimation(rOutAnim);
			viewFlipper.showPrevious();
			return true; 
Connect your IDE to all the code out there  Get Codota for Java