Code example for ViewAnimator

Methods: showPrevious

0
		final ViewAnimator pages = (ViewAnimator) findViewById(R.id.pages);
		Button prev = (Button) findViewById(R.id.prev);
		Button next = (Button) findViewById(R.id.next);
		prev.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				pages.showPrevious();
			} 
		}); 
		next.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				pages.showNext();
			} 
		}); 
 
		// 使用代码中定义的动画来覆盖xml文件中的动画 
		useCodeAnimation(pages);
 
		// ObjectAnimator动画 
		// 让小球滚动的动画 
		View rollingBall = findViewById(R.id.rollingball);
		ObjectAnimator ballRoller = ObjectAnimator.ofFloat(rollingBall,