I want to define a customer seekbar as described below, but how?
<p>I want to customize the seekbar to fit my needs:</p>

<p>The thumb can only be placed on four fixed location. for example, if I set the seekbar's max property to 120, the four fixed location is 0, 40, 80 120.
Also, I want to have indicators to tell people the means of the current selected location. so I do it as follows:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;

    &lt;LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:id="@+id/ll_id"
        android:paddingLeft="10dp"&gt;
        &lt;TextView
            android:id="@+id/tv1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="small"/&gt;
        &lt;View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"/&gt;
        &lt;TextView
            android:id="@+id/tv2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="middle"/&gt;
        &lt;View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"/&gt;
        &lt;TextView
            android:id="@+id/tv3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="big"/&gt;
        &lt;View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"/&gt;
        &lt;TextView
            android:id="@+id/tv4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="extrabig"/&gt;
    &lt;/LinearLayout&gt;
    &lt;SeekBar android:id="@+id/sk"
        android:layout_below="@+id/ll_id"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:max="120"
        android:paddingLeft="0dp"
        android:paddingRight="0dp"
        android:layout_marginRight="0dp"/&gt;
&lt;/RelativeLayout&gt;


public class CustomSeekBar extends FrameLayout {

    private SeekBar  sk;
    private OnWhichSelected selected;

    public CustomSeekBar(Context context) {  
        this(context, null);  
    }  

    public CustomSeekBar(Context context, AttributeSet attrs) {  
        super(context, attrs);
        LayoutInflater.from(context).inflate(R.layout.customseekbar_layout, this, true);
        sk  = (SeekBar)  this.findViewById(R.id.sk);
        sk.setProgress(0);
        callbackhelp(Which.SMALL);
        sk.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){
            @Override
            public void onProgressChanged(SeekBar seekBar, int progress,
                    boolean fromUser) {
                // TODO Auto-generated method stub
            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {
                // TODO Auto-generated method stub
            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {
                // TODO Auto-generated method stub
                int seekProgress = seekBar.getProgress();  
                if(seekProgress&lt;seekBar.getMax()/6){
                    callbackhelp(Which.SMALL);
                    seekBar.setProgress(0);
                }else if(seekProgress&gt;=seekBar.getMax()/6 &amp;&amp; seekProgress&lt;3*(seekBar.getMax()/6)){
                    callbackhelp(Which.MIDDLE);
                    seekBar.setProgress(seekBar.getMax()/3);
                }else if(seekProgress&gt;=3*(seekBar.getMax()/6) &amp;&amp; seekProgress&lt;5*(seekBar.getMax()/6)){
                    callbackhelp(Which.LARGE);
                    seekBar.setProgress(4*(seekBar.getMax()/6));
                }else if(seekProgress&gt;=5*(seekBar.getMax()/6)){
                    callbackhelp(Which.EX_LARGE);
                    seekBar.setProgress(seekBar.getMax());
                }
            }
        });
    }


    private void callbackhelp(Which which){
        if(selected!=null){
            selected.onSeleted(which);
        }
    }

    public enum Which{  
        SMALL,
        MIDDLE,
        LARGE,
        EX_LARGE
    }

    public interface OnWhichSelected{
        void onSeleted(Which which);
    }
}
</code></pre>

<p>Now the result is like this:<br>
the result<br>
<a href="https://i.stack.imgur.com/yKsAG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yKsAG.png" alt="enter image description here"></a></p>

<p>you can see the thumb does not  align center under the "middle" indicator, how to fix this so the thumb can be align center under every indicator on different devices? thanks</p>