Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ public class NumberProgressBar extends View {
private boolean mDrawReachedBar = true;

private boolean mIfDrawText = true;
private int mCustomValue;

public enum ProgressTextVisibility{
Visible,Invisible
Expand Down Expand Up @@ -287,8 +288,11 @@ private void calculateDrawRectFWithoutProgressText(){
}

private void calculateDrawRectF(){

mCurrentDrawText = String.format("%d" ,getProgress()*100/getMax());
if(mCustomValue == 0)
mCurrentDrawText = String.format("%d" ,getProgress()*100/getMax());
else{
mCurrentDrawText = String.format("%d" ,mCustomValue);
}
mCurrentDrawText = mPrefix + mCurrentDrawText + mSuffix;
mDrawTextWidth = mTextPaint.measureText(mCurrentDrawText);

Expand Down Expand Up @@ -387,6 +391,10 @@ public void setReachedBarColor(int ProgressColor) {
mReachedBarPaint.setColor(mReachedBarColor);
invalidate();
}
public void setCustomValue(int mCustomValue) {
this.mCustomValue = mCustomValue;
invalidate();
}

public void setMax(int Max) {
if(Max > 0){
Expand Down Expand Up @@ -488,5 +496,4 @@ public void setProgressTextVisibility(ProgressTextVisibility visibility){
}
invalidate();
}

}