2

How can I fill a bitmap in Android with a specific background, with only a percentage of it being covered, like below?

There would be a icon in the middle as well so the fill would have to be behind what is drawn. I tried using a gradient, but it wasn't fruitful.

half circle


Edit: Another image:

enter image description here

Assuming the Processing 67% is a textview and the green is the background that fills 67% of that Textview, how would you accomplish this in Android?

StackOverflowed
  • 5,854
  • 9
  • 55
  • 119
  • This link might be of some help for you - http://stackoverflow.com/questions/24858531/filling-a-circle-gradually-from-bottom-to-top-android/24866667?noredirect=1#comment38644747_24866667 – San Sep 21 '15 at 06:20

1 Answers1

1

You can try using Arc here is the reference Arc Android Developers and here is a great tutorial that might be of help to you: How to draw semicircle on Android Canvas.

other than that, would require a bit more of your code to help you out.

Community
  • 1
  • 1
Raykud
  • 2,488
  • 3
  • 21
  • 41
  • Sorry you may have misunderstood, I don't want to draw half circles, I want to fill an existing view (TextView, ImageView, etc) with a background colour to a certain percentage. See updated image please. – StackOverflowed Jun 19 '12 at 00:26
  • you still do it with the method i mentioned, you just have to be updating your view and setting the new xStart,yStart and xEnd, yEnd. and on that way you would be filling your view. – Raykud Jun 21 '12 at 23:45