0

the app called: SAO Widget

The battery bar have different color

and the bar will fit the unique shape background

also the battery percentage is tilted

using ImageView or ProgressBar?

Community
  • 1
  • 1
jk jk
  • 1,027
  • 2
  • 13
  • 28

1 Answers1

0

you can use progress bar with custom background and custom update colour to get this result, you can set progress bar after getting value of batter %age.

Saad Asad
  • 2,528
  • 3
  • 20
  • 27
  • look at this question for custom progress bar http://stackoverflow.com/questions/9921621/android-progressbar-ui-custom-layout – Saad Asad Mar 26 '13 at 12:37
  • Tried before,but still not found any method to tilt the bar progress,and the bar size not fitting the background too – jk jk Mar 26 '13 at 12:39
  • dont try to title the bar, use images which looks like titled – Saad Asad Mar 26 '13 at 12:42
  • if 100%,then the tilted part will overlapped the background?also 0% still have the tilted part looks like 5%? – jk jk Mar 26 '13 at 12:46
  • make an XML progressbar_bg.xml set a titled image for progress update as well and use it like android:progressDrawable="@drawable/progressbar_bg" – Saad Asad Mar 26 '13 at 12:54
  • I try this later,but can I use JAVA canvas/paint/bitmap to live create image? – jk jk Mar 26 '13 at 12:57
  • there can be another way, make a relative layout, make two imageViews in it one on another, and set background of imageView which is at front with your desired titled backgroud and set background of imageView behind with the image of your desired progress colour, increase width of imageView on behind according to battery %age – Saad Asad Mar 26 '13 at 13:02