Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setProgressDrawable fills the entire seekBar

As I say in the title, when I use setProgressDrawable, it fills the entire SeekBar: if progress is at 34%, progress show 100% but thumb shows the correct percentatge 34%. I don't figure out what can be the problem...

   done.setProgressDrawable(getResources().getDrawable(R.drawable.seekbar_progress));
   done.setThumb(getResources().getDrawable(R.drawable.seekbar_thumb));

seekbar_progress.xml

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke android:width="15dp"    android:color="#52a8ec"/>

seekbar_thumb.xml

    <shape xmlns:android="http://schemas.android.com/apk/res/android"
 android:shape="rectangle">
<gradient android:startColor="#ffffffff" android:endColor="#ff585858" android:angle="270"/>
<size android:height="17dp" android:width="5dp"/>
</shape>

Any idea?

Thank you in advance!

like image 656
anonymous Avatar asked Apr 15 '12 12:04

anonymous


1 Answers

try to put the fill shape inside a clip tag like so

<clip>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke android:width="15dp"    android:color="#52a8ec"/>
</clip>
like image 75
Dan Levin Avatar answered Oct 16 '22 01:10

Dan Levin