Code example for ViewSwitcher

Methods: setDisplayedChild

0
		viewSwitcher.setDisplayedChild(BUTTON_VIEW);
	} 
 
	public void showProgressBar() { 
 
		viewSwitcher.setDisplayedChild(PROGRESS_VIEW);
	} 
 
	/**  
	 * Slightly modified code, from Jake Wharton's ABS 
	 */ 
	private void showCheatsheet(Context context, View view) {
 
		final int[] screenPos = new int[2];
		final Rect displayFrame = new Rect();
		view.getLocationOnScreen(screenPos);
		view.getWindowVisibleDisplayFrame(displayFrame);
 
		final int width = view.getWidth();
		final int height = view.getHeight();
		final int midy = screenPos[1] + height / 2;