rename normalizeProgress
This commit is contained in:
parent
cfd37d4dbf
commit
a422b78d08
1 changed files with 6 additions and 4 deletions
|
@ -110,9 +110,9 @@ public abstract class BasicProgressAsyncTask<Tag, Params, Progress, Result> exte
|
||||||
|
|
||||||
public int getProgressPercentage() {
|
public int getProgressPercentage() {
|
||||||
if (work > 0) {
|
if (work > 0) {
|
||||||
return getCheckedProgressPercentage((progress * 100) / work);
|
return normalizeProgress((progress * 100) / work);
|
||||||
}
|
}
|
||||||
return getCheckedProgressPercentage(progress);
|
return normalizeProgress(progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInterrupted(boolean interrupted) {
|
public void setInterrupted(boolean interrupted) {
|
||||||
|
@ -136,8 +136,10 @@ public abstract class BasicProgressAsyncTask<Tag, Params, Progress, Result> exte
|
||||||
public void setGeneralProgress(String genProgress) {
|
public void setGeneralProgress(String genProgress) {
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getCheckedProgressPercentage(int progress) {
|
private int normalizeProgress(int progress) {
|
||||||
if (progress <= 100) {
|
if (progress < 0) {
|
||||||
|
return 0;
|
||||||
|
} else if (progress <= 100) {
|
||||||
return progress;
|
return progress;
|
||||||
} else {
|
} else {
|
||||||
return 99;
|
return 99;
|
||||||
|
|
Loading…
Reference in a new issue