Align Gallery's children left
<p>By default, android.widget.Gallery aligns its children center. I want to align them left.</p>

<p>I've tried @gibffe solution:
<a href="http://stackoverflow.com/questions/4341158/android-align-first-item-in-gallery-to-the-left">Android: Align first item in Gallery to the left</a></p>

<p>and also @MarvinLabs solution:
<a href="http://www.marvinlabs.com/2011/06/proper-layout-gravity-gallery-widget/" rel="nofollow">http://www.marvinlabs.com/2011/06/proper-layout-gravity-gallery-widget/</a></p>

<p>They are using the same way, which is to calculate the offset and minus it from the original left margin of the gallery. take a code snip here:</p>

<pre><code>int offset = galleryWidth / 2 - galleryItemWidth;
MarginLayoutParams mlp = (MarginLayoutParams) gallery.getLayoutParams();
mlp.setMargins(mlp.leftMargin-offset, mlp.topMargin, 
        mlp.rightMargin, mlp.bottomMargin);
</code></pre>

<p>A problem here is that, if we only change the left margin of the gallery without changing it's layout width. It's like "move" the gallery offset pixels left, thus we'll see the right edge of the gallery in the middle of screen instead of the right edge of screen.</p>

<p>Is there a good way to align the children left without "moving" the gallery?</p>
