title: Android drawable rotate inside button
body: <p>I need to have a button series with inside text and icon.
  The icon inside the 4 buttons must rotate to cover every poly.</p>
  
  <p>Follow an example with two buttons where the top is create with the original (vector drawable) icon and the "left" button rotating the vector.</p>
  
  <pre><code>        &lt;Button
              style="@style/Buttons.Small"
              android:drawableLeft="@drawable/ic_vertical_align_top_white_12dp"
              android:text="@string/optional" /&gt;
  
          &lt;Button
              style="@style/Buttons.Small"
              android:drawableLeft="@drawable/arrow_left"
              android:text="@string/optional" /&gt;
  </code></pre>
  
  <p>The vector drawable:
  <strong>ic_vertical_align_top_white_12dp</strong></p>
  
  <pre><code> &lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
   &lt;vector xmlns:android="http://schemas.android.com/apk/res/android"
       android:width="12dp"
       android:height="12dp"
       android:viewportHeight="24.0"
       android:viewportWidth="24.0"&gt;
       &lt;path
           android:fillColor="#FFFFFF"
           android:pathData="M8,11h3v10h2V11h3l-4,-4 -4,4zM4,3v2h16V3H4z" /&gt;    
   &lt;/vector&gt;
  </code></pre>
  
  <p>The rotate drawable:
  <strong>arrow_left.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;rotate xmlns:android="http://schemas.android.com/apk/res/android"
      android:fromDegrees="-90"
      android:toDegrees="-90"
      android:pivotX="50%"
      android:pivotY="50%"
      android:drawable="@drawable/ic_vertical_align_top_white_12dp"&gt;
  &lt;/rotate&gt;
  </code></pre>
  
  <p>The style</p>
  
  <pre><code>&lt;style name="Buttons.Small"&gt;
      &lt;item name="android:layout_width"&gt;wrap_content&lt;/item&gt;
      &lt;item name="android:layout_height"&gt;wrap_content&lt;/item&gt;
      &lt;item name="android:background"&gt;@color/buttonSmallBackground&lt;/item&gt;
      &lt;item name="android:layout_margin"&gt;2dp&lt;/item&gt;
      &lt;item name="android:minHeight"&gt;0dp&lt;/item&gt;
      &lt;item name="android:minWidth"&gt;0dp&lt;/item&gt;
      &lt;item name="android:textSize"&gt;12sp&lt;/item&gt;
      &lt;item name="android:drawablePadding"&gt;4dp&lt;/item&gt;
      &lt;item name="android:paddingLeft"&gt;4dp&lt;/item&gt;
      &lt;item name="android:paddingRight"&gt;4dp&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>And following the result</p>
  
  <p><strong>Nougat</strong> (PERFECT)</p>
  
  <p><a href="https://i.stack.imgur.com/QPSPA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QPSPA.jpg" alt="enter image description here"></a></p>
  
  <p><strong>Marshmallow</strong> (WRONG)</p>
  
  <p><a href="https://i.stack.imgur.com/FW7r2.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FW7r2.jpg" alt="enter image description here"></a></p>
  
  <p>I already tried to play with the vector <code>viewport</code> without success.</p>
  
  <p>Thanks</p>