0

I want to achieve this:

At this point in time i am at

My problem is i want to remove the space between the "montant demande" and the seekbar. This is not due to top margin or padding because i have not set any top/bottom margin or padding.

secondly. how to set the bar below the seekbar thumb so that the thumb can move over the vertical bar.

For the seekbar, i use a custom xml background. the code is shown below.

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@android:id/background">
        <shape>
            <gradient
            android:startColor="#ffffffff"
                android:centerColor="#ffdddddd"
                android:centerY="0.20"
                android:endColor="#ffffffff"
                android:angle="270"/>

            <padding android:left="1dp"
            android:top="1dp"
            android:right="1dp"
            android:bottom="1dp"/> 
        <corners android:radius="1dp"/> 
    </shape>
</item>



<item android:id="@android:id/progress">
    <clip>
       <shape>
            <gradient
                    android:startColor="#ff0e75af"
                    android:endColor="#ff1997e1"
                    android:angle="90" />
            <padding android:left="1dp"
                android:top="1dp"
                android:right="1dp"
                android:bottom="1dp"/> 
            <corners android:radius="1dp"/> 
        </shape>
    </clip>
    </item>
</layer-list>

and in my main.xml the seekbar has the following attribute.

<SeekBar
            android:id="@+id/seekvalue"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/eight_dp"
            android:layout_marginRight="@dimen/eight_dp"
            android:background="@color/fulll_transparent"
            android:indeterminate="false"
            android:max="48500"
            android:maxHeight="12dip"
            android:minHeight="5dp"
            android:paddingLeft="@dimen/twenty_sp"
            android:paddingRight="@dimen/ten_dp"
            android:progressDrawable="@drawable/progressbar"
            android:thumb="@drawable/slider"
            android:thumbOffset="-1px" />
Dimitri
  • 677
  • 3
  • 19
  • 46

2 Answers2

1

set maxHeight and minHeight value same and increase or decrease both value according to place thumb over the progress line.

0

You need to use transparent img and there should not be any padding in img.I think ur img corner is transparent so it occupy space remove that.Basically you need to use five img

1.seekbartotal background
2.seekbar played background
3.seekbar buffered backgroung
4.seekbar thumb and finally 
5.seekbar thumb focus

for further look this hope this will help you lot.

Dilip
  • 2,271
  • 5
  • 32
  • 52
  • yeah good if this help u out then accept this so other will take benefit of this answer – Dilip May 08 '13 at 06:30
  • i haven't found a solution yet Dipu. base on what you said, i need to use a progressbar and a seekbar, in the seekbar set the progress height to 0 or transparent then move the thumb and set progress on the progress bar is that it ? – Dimitri May 08 '13 at 06:34
  • follow the link maintained in my answer – Dilip May 08 '13 at 06:37
  • can you give me an example here based on my question please – Dimitri May 08 '13 at 06:58
  • read blog properly everything is there and ask then what difficulties u have – Dilip May 08 '13 at 07:21