title: How to set background image for custom radio button android with original scale ratio?
body: <p>I need to implement a timeline bar as attached image</p>
  
  <blockquote>
    <p><img src="https://i.stack.imgur.com/vNVFR.jpg" alt="enter image description here"></p>
  </blockquote>
  
  <p>I try to use custom radio button to draw each node:
  <strong>layout xml</strong> file:</p>
  
  <pre><code>&lt;LinearLayout 
  android:layout_width="match_parent"
      android:layout_height="0dp"
      android:layout_weight="2"
      android:orientation="vertical"
      android:layout_gravity="center"
      android:gravity="center"
      android:paddingLeft="50dp"
      android:paddingRight="50dp"
      &gt;
      &lt;RadioGroup 
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:orientation="horizontal"
         android:layout_gravity="center"
         android:gravity="center"
         android:checkedButton="@+id/first"&gt;
         &lt;RadioButton android:id="@+id/first"
            style="@style/timeLineRadioButton"/&gt;
         &lt;RadioButton android:id="@+id/second"
            style="@style/timeLineRadioButton"/&gt;
         &lt;RadioButton android:id="@+id/third"
            style="@style/timeLineRadioButton"/&gt;
         &lt;RadioButton android:id="@+id/fourth"
            style="@style/timeLineRadioButton"/&gt;
      &lt;/RadioGroup&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>res/values/style.xml</strong>:</p>
  
  <pre><code>&lt;style name="timeLineRadioButton"&gt;
      &lt;item name="android:layout_width"&gt;0dp&lt;/item&gt;
      &lt;item name="android:layout_weight"&gt;1&lt;/item&gt;
      &lt;item name="android:gravity"&gt;top|center&lt;/item&gt;
      &lt;item name="android:layout_height"&gt;match_parent&lt;/item&gt;
      &lt;item name="android:button"&gt;@null&lt;/item&gt;
      &lt;item name="android:background"&gt;@drawable/button_radio&lt;/item&gt;
      &lt;item name="android:scaleType"&gt;matrix&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p><strong>res/drawable/button_radio.xml</strong> </p>
  
  <pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    &lt;item android:state_checked="true" android:state_pressed="false"
        android:drawable="@drawable/radio_button_pressed"/&gt;
    &lt;item android:state_checked="false" android:state_pressed="false"
        android:drawable="@drawable/radio_button"/&gt;
    &lt;item android:state_checked="true" android:state_pressed="true"
        android:drawable="@drawable/radio_button_pressed"/&gt;
    &lt;item android:state_checked="false" android:state_pressed="true"
        android:drawable="@drawable/radio_button"/&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>The timeline display ok, but background was scale with different ratio 
  <img src="https://i.stack.imgur.com/tTkXA.jpg" alt="https://dl.dropboxusercontent.com/u/5860710/timeline.jpg"></p>
  
  <p>so, please help me to fix background image with original ratio scale</p>