AttributeSet automodified in custom view
<p>I have a custom view defined this way (margin bottom is just to highlight the problem):</p>

<pre><code>public class PoleButtonView extends LinearLayout {
    public PoleButtonView(Context context) {
        super(context);
    }
    public PoleButtonView(Context context, AttributeSet attrs) {
        super(context, attrs);
        String marginBottom = attrs.getAttributeValue("http://schemas.android.com/apk/res/android", "layout_marginBottom");
    }
    public PoleButtonView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }
    @Override
    public LayoutParams generateLayoutParams(AttributeSet attrs) {
        String marginBottom = attrs.getAttributeValue("http://schemas.android.com/apk/res/android", "layout_marginBottom");
        return new LayoutParams(getContext(), attrs);
    }
}
</code></pre>

<p>and the corresponding pole_button.xml:</p>

<pre><code>&lt;com.***.PoleButtonView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/poleButtonRoot"
    android:orientation="vertical"
    android:layout_alignParentLeft="true" android:layout_weight="1"
    android:layout_width="0dp" android:layout_height="fill_parent"
    android:layout_marginBottom="30dp"&gt;
    ****** OTHER VIEWS HERE *******
&lt;/com.***.PoleButtonView&gt;
</code></pre>

<p>I instantiate the class in the Activity this way:</p>

<pre><code>    LayoutInflater mInflater = LayoutInflater.from(this);

    View contentView = mInflater.inflate(R.layout.pole_button, null); 
</code></pre>

<p>What I can't get my arms around is why marginBottom is 30.0dip in the constructor (same value as the xml which I expected) while marginBottom is 10.0dip in the overriden generateLayoutParam. The problem is confirmed on screen (10dp bottom margin) and when changing 30dp to another value in the pole_button.xml file which has NO effect on the bottom margin.</p>
