daimajia / NumberProgressBar

A beautiful, slim Android ProgressBar.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

setMax() not working.

maxgmer opened this issue · comments

I have an issue. No matter if I called setMax() before, max value of my progress bar stays 100.

btw my progress bar is in RecyclerView.

@Dona278 same problem( i use progressbar.setProgress() and progressbar.setMax(). Am i right? Are there any library methods to set progress and maximum value?

I think that 100 is the percentage of progressbar. The percentage shown is a proportion between current value and the max value. For example, if you set max value to 4 and current value to 2 you will see 50 on the progressbar. If you want to show a value that is different from the classic percentage you can use .setCustomValue(). For example if you set max value to 12 and current value to 10 you can use custom value to show 10 instead of 83 and with suffix you can add custom text like "10 level".

my setmax value is 1000, but setProgress(99) sets 99% on progress bar.

Using this code:

NumberProgressBar progressBar = (NumberProgressBar) findViewById(R.id.numberbar1);
progressBar.setMax(1000);
progressBar.setProgress(99);

I had this result:
image

should i use the same import to use your library?

To import library into your project:

Project build.gradle

allprojects {
     repositories {
         maven { url "http://dl.bintray.com/dona278/maven/" }
     }
}

Module build.gradle

dependencies {
   compile "com.daimajia.numberprogressbar:library:1.3@aar"
}

Maven repository url and version of library are changed from the original.
In your activity the code remains unchanged.

image

Due to wrong understanding of the percentage, close this issue.