Difference between setTranslationX/Y and offsetLeftAndRight/offsetTopAndBottom? : <p>I'm working with a <code>CoordinatorLayout</code> in which child views positions are being animated with the <code>ViewCompat.offsetLeftAndRight</code> and <code>ViewCompact.offsetTopAndBottom</code> APIs.</p>

<p>When a child view is added or removed from the <code>CoordinatorLayout</code>, the layout operation resets the position of each child to the top left corner of the screen, i.e. without any offset.</p>

<p>This <a href="http://sentinelweb.co.uk/offsetleftandright-not-preserving-after-a-layout/" rel="noreferrer" title="article">article</a> provides a solution, by setting a layout listener on the child view and restoring old positions.</p>

<p>I noticed that using the <code>setTranslationX</code> and <code>setTranslationY</code> APIs, this problem does not occur. Children keep their position after parent layout events.</p>

<p>How should I decide between these two sets of APIs for arranging my views on screen? I'm wary of using either without understanding their differences. I did not get a good understanding by reading the official documentation.</p>
