1

I've been trying to search on Google ways to implement percents (%) user interface and couldn't find anything that may help! My goal is to make progress like the Bootstrap Progress bar (see here) in Android.

My goal is to show player win percentage (like 55%) in a modern way.

I've been checking the ProgressBar and ProgressDialog but they are just progress circles for data and has nothing to do with what I need.

The closest thing I faced is the SeekBar, but SeekBar meant to be changed, and I need only an indicator for showing percentage without changing it.

Of course I can make a label and write "55%" but I'm pretty sure there is something modern out there.. Any idea for it?

Thank you!

Marc Plano-Lesay
  • 6,808
  • 10
  • 44
  • 75
  • These might me helpful: http://www.101apps.co.za/index.php/articles/android-s-progress-bars.html ProgressBar with percentage: http://custom-android-dn.blogspot.in/2013/01/how-to-create-custom-progress-bar-and.html – Sharath Dec 15 '15 at 18:09

3 Answers3

1

I've been checking the ProgressBar and ProgressDialog but they are just progress circles for data and has nothing to do with what I need.

ProgressBar has multiple styles. While the default style is a circle, you are welcome to style it as a bar, using style="@android:style/Widget.ProgressBar.Horizontal", as is covered in the documentation, or via style="?android:attr/progressBarStyleHorizontal" as is shown in this sample app.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Thanks! Is it possible to label inside the ProgressBar? like writing number of precentage or descriptive label? – AndroidWonderer Dec 15 '15 at 18:16
  • @AndroidWonderer: `ProgressBar` does not have support for that directly. You can try layering a `TextView` on top of it, or subclassing `ProgressBar` and rendering your own text, or look for a third-party progress indicator library that has features that you like. – CommonsWare Dec 15 '15 at 18:18
1

A ProgressBar is indeed the widget you're looking for. If the default style is a circle, displaying an indeterminate progress, you can switch to a linear one:

<ProgressBar
     style="@android:style/Widget.ProgressBar.Horizontal" />

Then you can define a max value (android:max) and a specific percent with setProgress(int progress).

Marc Plano-Lesay
  • 6,808
  • 10
  • 44
  • 75
1

Here is your Bootstrap for Android:

https://github.com/Bearded-Hen/Android-Bootstrap

Iliiaz Akhmedov
  • 867
  • 7
  • 17