Code example for ViewAnimator

Methods: getChildCount, removeViewAt, setInAnimation, setOutAnimation

0
			setSelection(0);
		}else { 
			setSelection(getSelectedItemPosition()+1);
		} 
		//make sure we clean up after us. Remove the temporary view 
		if(viewAnimator!=null && viewAnimator.getChildCount()==2){
			//remove animations in order to make sure event listener is not triggered 
			viewAnimator.setInAnimation(null);
			viewAnimator.setOutAnimation(null);
			viewAnimator.removeViewAt(1);
			ongoingAnimation=false;
		} 
		// 
		 
		//let's make sure the visibility of the title matches what the user wants 
		//this is required since the view may be cached when the visibility was changed 
		View selectedView = getSelectedView();
		ImageAdapter adapter = (ImageAdapter)getAdapter();
		int visibility =adapter.shouldDisplayPhotoTitle()?View.VISIBLE:View.INVISIBLE;
		SlideshowActivity.setVisibilityOfSlideshowText(selectedView,visibility);