title: Unable to resize the thumb of Seekbar android
body: <p>I have tried different ways to resize the thumb size of <code>Seekbar</code> but got no success.<br/>
  This is the thumb of my <code>Seekbar</code> with pressed effect too:</p>
  
  <p><a href="https://i.stack.imgur.com/Wc80b.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Wc80b.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/llx03.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/llx03.png" alt="enter image description here"></a><br/>
  My thumb selector file where I have added these two images to get press effect:<br/><br/>
  lessons_thumb_selector:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item android:drawable="@drawable/lessons_thumb" android:state_pressed="false"/&gt;
      &lt;item android:drawable="@drawable/lessons_pressed"/&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>And my thumb file where I have resized the thumb selector:<br/><br/>
  thumb_drawable_lessons.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/lessons_thumb_selector"
          android:width="50dp"
          android:height="50dp"/&gt;
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>And my <code>Seekbar</code> tag in layout file where I have used the Seekbar with this thumb is:<br/></p>
  
  <pre><code>    &lt;SeekBar
      android:id="@+id/sBarLessons"
      android:layout_centerInParent="true"
      android:progressDrawable="@drawable/styledprogrees"
      android:thumb="@drawable/thumb_drawable_lessons"
      style="@style/book_categories_seekbar_style"
      /&gt;
  </code></pre>
  
  <p>And style tag in style.xml file is this:
       
              430dp
              175dp
              @color/transparent
              100
              10dp
              false
          
  And the problem is! everything looks fine when I see in Android Studio layout preview:<br/><br/>
  <a href="https://i.stack.imgur.com/lYPTE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lYPTE.png" alt="enter image description here"></a>
  <br/><br/>But when i execute and install apk on device it shows thumb size the same and dislocated from <code>Seekbar</code>:<br/><br/>
  <a href="https://i.stack.imgur.com/mVdpu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mVdpu.png" alt="enter image description here"></a>
  Note: <br/>
   - Press effect is working fine.<br/> 
   - Using the same image for 10 inch device and trying to resize it for 7 inch device.<br/>
   - Please note aligning is not an issue, issue is resizing. I want to reduce the size of thumb proportionately.<br/>
   - Also generating 9-patch doesn't help in my solution.<br/>
   - Using Lolipop 5.1.1 version in my devices.</p>
  
  <p>I have tried these solutions too but got no success:<br/>
  <a href="https://stackoverflow.com/questions/2912609/android-seekbar-thumb-gets-clipped-cut-off">Android SeekBar thumb gets clipped/cut off</a><br/>
  <a href="https://stackoverflow.com/questions/21802231/dynamically-resized-thumb-of-seekbar-gets-clipped-above-and-below-how-to-draw-o">dynamically resized Thumb of SeekBar gets clipped above and below, how to draw on top (Z order)?</a><br/>
  <a href="https://stackoverflow.com/questions/21401884/android-resizing-seekbar-thumb-width-from-maximum-value">Android resizing SeekBar thumb width from maximum value</a><br/></p>