I would like to have this seekbar in my Android project :
This is my seekbar :
<SeekBar
android:id="@+id/seekBar_luminosite"
android:layout_width="@dimen/seekbar_width"
android:layout_height="@dimen/seekbar_height"
android:minHeight="15dp"
android:minWidth="15dp"
android:maxHeight="15dp"
android:maxWidth="15dp"
android:progress="@integer/luminosite_defaut"
android:progressDrawable="@drawable/custom_seekbar"
android:thumb="@drawable/custom_thumb" />
This is my custom_thumb.xml :
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval" >
<gradient
android:angle="270"
android:endColor="@color/colorDekraOrange"
android:startColor="@color/colorDekraOrange" />
<size
android:height="35dp"
android:width="35dp" />
</shape>
This is my custom_seekbar.xml :
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@android:id/background"
android:drawable="@drawable/seekbar"/>
<item android:id="@android:id/progress">
<clip android:drawable="@color/colorDekraYellow" />
</item>
</layer-list>
This is my seekbar.png (background) :
No shadow and no rounded borders in the bar...
I really not understand how I can do.
android:minHeight
android:maxHeight
– Blueingandroid:progressDrawable
– Construeandroid:minHeight
andandroid:maxHeight
to the same large value, it will increase the 'hit' area of the thumb, to make it much easier to grab and move (Set both values to avoid bugs on Android 4.4). Android 6/7 has a default SeekBar height which is very small, making it hard to click on. – Stingaree