Android - getting the dimensions of a view in order to position it
<p>I've got a tiled pan-n-zoom component that uses several FrameLayouts to position image tiles (that scale), markers (that move, but don't scale) and controls (which neither move nor scale).  It works fine.</p>

<p>Markers are positioned in a FrameLayout with topMargin and leftMargin.  So far so good.</p>

<p>When a marker is touched, I need to open a little popup, at the same position as the marker that was touched <em>but offset by the dimensions of the popup</em>.  That's to say that if the popup is 100 pixels wide and 50 pixels tall, and the marker touched was at 800 x and 1100 y, the popup should be at 750 x (postion of marker minus half the width of the popup) and 1050 y (position of the marker minus the full height of the popup).  The effect is like a tooltip - a little nub points down at the marker, etc.</p>

<p>The popup dimensions are flexible, based on the text to be displayed, and need to be calculated.</p>

<p>Obviously the dimensions aren't available until after layout happens.  What's the best way to get these dimensions and react accordingly?</p>

<p>(should mention that a RelativeLayout is not an option)</p>

<p>TYIA.</p>

<p>/EDIT
looks like I can get the dimensions of the children in onMeasure and onLayout, but re-applying a new layout in one of these handlers would create an infinite loop - setting a flag to catch just the first pass did not work.  i guess the updated question would be "now that I know where I can get the information, how should I react and position it?"</p>
