Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid progress bar fill
    text
    copied!<p>I want a loading bar in a circle shape. I want to fill it with an integer i tried this</p> <pre><code> &lt;ProgressBar android:id="@+id/progressBar" style="?android:attr/progressBarStyleLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:indeterminateDrawable="@xml/progress" &gt; &lt;/ProgressBar&gt; </code></pre> <p>progress.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;rotate xmlns:android="http://schemas.android.com/apk/res/android" android:fromDegrees="0" android:pivotX="50%" android:pivotY="50%" android:toDegrees="360" &gt; &lt;shape android:innerRadiusRatio="3" android:shape="ring" android:thicknessRatio="8" android:useLevel="false" &gt; &lt;size android:height="48dip" android:width="48dip" /&gt; &lt;gradient android:centerY="0.50" android:endColor="#000000" android:startColor="#ffffff" android:gradientRadius="20" android:type="radial" android:useLevel="false" /&gt; &lt;/shape&gt; </code></pre> <p></p> <p>and in my activity</p> <pre><code> protected void onPostExecute(Void result) { bar.setProgress(50); bar.setMax(100); bar.setVisibility(View.VISIBLE); } </code></pre> <p>The Circle stays black. If i set the gradient type to sweep, the circle fills with startcolor black and endcolor white.. and it constantly repeats.</p> <p>But I want the circle to be filled once.. so it starts black and fills white; only 1 time..</p> <p>Is this possible?</p> <p>I want to reach this result: </p> <p><a href="http://ultimateprogrammingtutorials.blogspot.be/2013/02/how-to-draw-circular-progress-bar-in.html" rel="nofollow">http://ultimateprogrammingtutorials.blogspot.be/2013/02/how-to-draw-circular-progress-bar-in.html</a></p>
 

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