title: Content area defined in 9 patch image doesn't work for custom view
body: <p>Currently, I have a custom view <code>BarChart</code>. I wish to have some red shadowing effect on it. I'm using nine patch image technique to achieve so.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:minHeight="240dp"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@drawable/card_background_red"
      android:orientation="vertical"
      android:padding="0dp" &gt;
  
      &lt;org.yccheok.jstock.gui.charting.BarChart
          android:id="@+id/bar_chart"
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_weight="1" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>In my custom view, there is line of code, where I will draw string at the end-y of the view.</p>
  
  <pre><code>// Drawing string at end-y of BarChart custom view.
  canvas.drawText("2007", x0, getHeight(), textPaint); 
  canvas.drawText("2008", x1, getHeight(), textPaint);
  </code></pre>
  
  <p>I avoid my custom view from <strong>"touching"</strong> any of the red shadow, I define my content area of 9-patch, so that it doesn't touch the red shadow.</p>
  
  <p>As you can see, the <strong>content area</strong> are pretty much stay away from red shadow.</p>
  
  <p><img src="https://i.stack.imgur.com/y1Ay0.png" alt="enter image description here"></p>
  
  <p>I thought my drawn text will never touch the red shadow area, as I restrict my content area (entire custom view?) stay away from red shadow area. However, it doesn't work.</p>
  
  <p><img src="https://i.stack.imgur.com/tqKiS.png" alt="enter image description here"></p>
  
  <p>Am I having wrong expectation on the content area of 9 patch image? I thought Linear Layout's "content" is my custom view <code>BarChart</code>. Hence, <code>BarChart</code> shouldn't be touching the red shadow as specific in 9 patch image. (<a href="http://www.shubhayu.com/android/9-patch-image-designers-vs-developers" rel="nofollow noreferrer">http://www.shubhayu.com/android/9-patch-image-designers-vs-developers</a>)</p>