title: Android layout background xml texture
body: <p>I searched a lot but didn't find anything. I want to make a background for a layout , but instead of filling it with a color or a gradient I want to fill it with a texture and repeat it . I tried this but it didn't work . Can you tell me a solution.</p>
  
  <p>card_texture.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;bitmap
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:src="@drawable/paper_texture"
          android:tileMode="repeat"
      /&gt;
  </code></pre>
  
  <p>card_shape.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;shape
  
      android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
      &lt;solid android:color = "@android:color/transparent"/&gt;
  
      &lt;stroke android:width="2dp"
          android:color="@color/text_color"/&gt;
  
      &lt;corners
          android:radius="20dp"
          /&gt;
  
  &lt;/shape&gt;
  </code></pre>
  
  <p>card_background.xml</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:drawable="@drawable/card_texture" &gt;
         &lt;corners
              android:radius = "20dp"/&gt;
  
      &lt;/item&gt;
      &lt;item android:drawable="@drawable/card_shape" /&gt;
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>and this is how I use it in my Layout <code>android:background="@drawable/card_background"</code></p>
  
  <p>I get something like this. But I want the corners(marked with red) of the texture to be transparent and to fit in the black border</p>
  
  <p><img src="https://i.stack.imgur.com/uo4yl.png" alt="screenshot"></p>