Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I solved the problem by using .xml shape as background for my SeekBar. The complete SeekBar solution that can be used via setProgressDrawable() method should be like this:</p> <pre><code>//seek_bar.xml &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:id="@android:id/background" android:drawable="@drawable/seek_bar_background"/&gt; &lt;item android:id="@android:id/progress" android:drawable="@drawable/seek_bar_progress" /&gt; &lt;/layer-list&gt; //seek_bar_background.xml &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;shape xmlns:android="http://schemas.android.com/apk/res/android" &gt; &lt;gradient android:angle="270" android:startColor="#8a8c8f" android:endColor="#58595b" /&gt; &lt;corners android:radius="5dip" /&gt; &lt;/shape&gt; //seek_bar_progress.xml &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:id="@android:id/background" android:drawable="@drawable/seek_bar_background"/&gt; &lt;item android:id="@android:id/progress"&gt; &lt;clip android:drawable="@drawable/seek_bar_progress_fill" /&gt; &lt;/item&gt; &lt;/layer-list&gt; //seek_bar_progress_fill.xml &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;shape xmlns:android="http://schemas.android.com/apk/res/android" &gt; &lt;gradient android:startColor="#b3d27e" android:endColor="#93c044" android:angle="270" /&gt; &lt;corners android:radius="5dip" /&gt; &lt;/shape&gt; </code></pre> <p>In the code, you can use it like this:</p> <pre><code>progressBar.setProgressDrawable(getResources().getDrawable(R.drawable.seek_bar)); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload