title: How to change the margin of an "included" layout programatically
body: <p>I have a LinearLayout inside which I am including a different layout. Something like this</p>
  
  <pre><code>&lt;LinearLayout
                      android:id="@+id/linear_layout"
                      android:layout_width="match_parent"
                      android:layout_height="20dp"
                      android:visibility="gone"
                      tools:visibility="visible"&gt;
  
                      &lt;include
                          layout="@layout/new_layout"
                          android:layout_width="0dp"
                          android:layout_height="match_parent"
                          android:layout_marginBottom="4dp"
                          android:layout_marginLeft="4dp"
                          android:layout_marginStart="4dp"
                          android:layout_weight="1"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Now what I would like to do is, to programmatically change the "marginBottom" of the included layout (new_layout). How can I do that? </p>
  
  <p>I tried calling various LayoutParams and tried changing the margin, but not sure if it is the right approach. Any help greatly appreciated. </p>
  
  <p>Thanks</p>