Code example for ViewSwitcher

Methods: setDisplayedChild

0
	public void setOnRefreshListener(OnRefreshListener onRefreshListener) {
		onRefreshClickListener = onRefreshListener;
	} 
	 
	public void stopLoading() { 
		viewSwitcher.setDisplayedChild(BUTTON_VIEW);
	} 
	 
	public void startLoading() { 
		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);