daimajia / NumberProgressBar

A beautiful, slim Android ProgressBar.
MIT License
6.07k stars 1.4k forks source link

setMax() not working. #39

Closed maxgmer closed 7 years ago

maxgmer commented 7 years ago

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

maxgmer commented 7 years ago

btw my progress bar is in RecyclerView.

Dona278 commented 7 years ago

@maxgmer Try with https://github.com/Dona278/NumberProgressBar

maxgmer commented 7 years ago

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

Dona278 commented 7 years ago

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".

maxgmer commented 7 years ago

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

Dona278 commented 7 years ago

Using this code:

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

I had this result: image

maxgmer commented 7 years ago

should i use the same import to use your library?

Dona278 commented 7 years ago

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.

daimajia commented 7 years ago

image

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