title: Android : stroke in a shape create a margin of the stroke width
body: <p>I created a rectangle shape in order to use it as list item background. My problem is the stroke does not follow the view border but let a margin of +/- the stroke width.</p>
  
  <p>Here is the xml of my shape :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;shape xmlns:android="http://schemas.android.com/apk/res/android"
      android:innerRadiusRatio="1"
      android:shape="rectangle" &gt;
      &lt;solid android:color="@color/deminoir" /&gt;
      &lt;stroke
          android:width="4dp"
          android:color="@color/deminoir" /&gt;
      &lt;padding
          android:bottom="4dp"
          android:left="4dp"
          android:right="4dp"
          android:top="4dp" /&gt;
  &lt;/shape&gt;
  </code></pre>
  
  <p>And here is the xml of my style :</p>
  
  <pre><code>&lt;style name="champ"&gt;
      &lt;item name="android:layout_width"&gt;match_parent&lt;/item&gt;
      &lt;item name="android:layout_height"&gt;wrap_content&lt;/item&gt;
      &lt;item name="android:orientation"&gt;vertical&lt;/item&gt;
      &lt;item name="android:background"&gt;@drawable/bordurechamp&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>And finaly the xml of my list item view :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      style="@style/champ" &gt;
  
  
      &lt;!-- titre --&gt;
      &lt;TextView
          android:id="@+id/titre"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:background="@color/deminoir"
          android:padding="5dip"
          android:text="titre"
          android:textAppearance="@android:style/TextAppearance.Large" /&gt;
  
      &lt;!-- Contenu --&gt;
      &lt;TextView
          android:id="@+id/valeur"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:gravity="center_horizontal"
          android:padding="5dip"
          android:text="valeur"
          android:textAppearance="@android:style/TextAppearance.Medium"
          /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>