Code example for ViewTreeObserver

Methods: addOnGlobalLayoutListener

0
	/** 
	 * Ensures primaryView has finished drawing before getting height 
	 */ 
	public void setObserverOnPrimary() { 
		observer = primaryView.getViewTreeObserver();
		observer.addOnGlobalLayoutListener(this);
	} 
	 
	/** 
	 * Returns the primary view 
	 * @return View primaryView 
	 */ 
	public View getPrimaryView() { return primaryView; }
	 
	 
	/** 
	 * Set the secondary view - the one which is revealed when the primary view 
	 * is clicked. 
	 *  
	 * @param view View to be set as secondary