title: Change Margin of a Layout using XML in Layer-List
body: <p>I tried several options but I can't find the best way to do this: <strong>I want to change the margin of a Linear Layout when button is clicked using XML.</strong> Here's my code for the selected button:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  
      &lt;item android:bottom="-1dp"&gt;
          &lt;shape android:shape="rectangle" &gt;
              &lt;corners
                  android:topLeftRadius="5dp"
                  android:topRightRadius="5dp" /&gt;
  
              &lt;solid android:color="#424346" /&gt;
  
              &lt;stroke
                  android:width="1dp"
                  android:color="#2d2e2f" /&gt;
          &lt;/shape&gt;
      &lt;/item&gt;
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>Now I want to add the changing of margin which if put in a separate file would look like this:</p>
  
  <pre><code>&lt;resources&gt;
      &lt;style android:id="@+id/tab_label" &gt;
          &lt;item android:layout_marginTop="7dp"/&gt;
      &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>I tried adding it as an item to the layer list but it returns an error.</p>
  
  <p>Putting it in another file is quite problematic because Android can't allow two styles to be used in one element. So I want to merge the two things in one XML file. </p>
  
  <p>Or, what's the best way doing this?</p>