I want to create a circular progressbar, like in this image below
I don't know what the method that creates this progressbar is. And I don't know what assets should be prepared.

- 161
- 2
- 13

- 430
- 1
- 9
- 18
-
have a look at this http://stackoverflow.com/questions/2819778/custom-drawable-for-progressbar-progressdialog – itsrajesh4uguys Mar 05 '13 at 11:51
-
maybe this can point you in the right direction https://github.com/grmaciel/two-level-circular-progress-bar – gmemario Oct 13 '15 at 23:26
5 Answers
Have a look at this sample you will be having nice sample here:
It will be look like following images.
Hope this will help you.

- 16,027
- 12
- 69
- 122

- 4,610
- 3
- 20
- 31
-
HI this is working fine i am implementing ontouch methode in this i am call incrementProgress() in MotionEvent.ACTION_MOVE is call forword but i need both forward and back,how to do this please help me.. – sai Aug 08 '13 at 12:30
-
Hi itsrajesh, this code is very nice.. i need some changes in this code. i want change the color for circle progress. i could not do.what i want for, at runtime,when progress is crossed particular percentage,i need to change the circle bar color.. pls if possible help me.. – harikrishnan Aug 28 '13 at 14:56
Try the following link.. I will be helpful for you.. We need to customize the views to create a new one.. Instead of customizing our own view we can add library projects and and use the views..
Follow this for library project,
http://www.androidviews.net/2013/03/holo-circular-progressbar/
http://www.androidviews.net/2013/02/circular-seekbar/
And this for customizing our own view,
http://www.vogella.com/articles/AndroidCustomViews/article.html

- 1,760
- 15
- 20
try this method to draw a bitmap and set it to image view. use it in a dialog to create a circular progress dialog.
private void circularImageBar(ImageView iv2, int i) {
Bitmap b = Bitmap.createBitmap(300, 300,Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(b);
Paint paint = new Paint();
paint.setColor(Color.parseColor("#c4c4c4"));
paint.setStrokeWidth(10);
paint.setStyle(Paint.Style.STROKE);
canvas.drawCircle(150, 150, 140, paint);
paint.setColor(Color.parseColor("#FFDB4C"));
paint.setStrokeWidth(10);
paint.setStyle(Paint.Style.FILL);
final RectF oval = new RectF();
paint.setStyle(Paint.Style.STROKE);
oval.set(10,10,290,290);
canvas.drawArc(oval, 270, ((i*360)/100), false, paint);
paint.setStrokeWidth(0);
paint.setTextAlign(Align.CENTER);
paint.setColor(Color.parseColor("#8E8E93"));
paint.setTextSize(140);
canvas.drawText(""+i, 150, 150+(paint.getTextSize()/3), paint);
iv2.setImageBitmap(b);
}

- 3,394
- 3
- 30
- 36
you can do this by creating a custom view . about assets i guess all you need is some color codes . create a class extends View . add method setProgress(int) . in OnDraw() draw one filled circle . and one arc from 0 to _progress . drawText progress at center . you can find sample code easily . search for it .

- 8,172
- 3
- 35
- 40