How to center a background tile?
<p>I'm trying to create a tiled background for a <code>match_parent</code>-wide container, where the tile is repeated from the parent's center, not from its left edge. I want this in order for the background to always appear centered regardless of screen width.</p>

<p>I noticed that Android's <code>BitmapDrawable</code> has a <code>gravity</code> attribute, but it seems to have no effect when <code>tileMode</code> is set to <code>repeat</code> or <code>mirror</code>. I would have expected that the bitmap is first centered in its container, then repeated outwards from the center point. Instead, it's still left-aligned and then repeated, resulting in the first tile always be fully visible but the last tile being cut off unless the screen width is a multiple of the tile's width.</p>

<p>UPDATE: Just noticed, "Gravity is ignored when the tile mode is enabled." (tileMode attr docs.) Any other ways to achieve this?</p>
