Rename ProgressDialogUpdater to Progressable

Also fix some inconsistent usages of "progress", now using
"progressable" in all builders.
This commit is contained in:
Thialfihar
2014-04-29 18:44:44 +02:00
parent 6a1832ebad
commit 9e6bf2abbb
8 changed files with 57 additions and 54 deletions

View File

@@ -17,15 +17,18 @@
package org.sufficientlysecure.keychain.util;
/** This is a simple class that wraps a ProgressDialogUpdater, scaling the progress
import org.sufficientlysecure.keychain.pgp.Progressable;
/**
* This is a simple class that wraps a Progressable, scaling the progress
* values into a specified range.
*/
public class ProgressScaler implements ProgressDialogUpdater {
public class ProgressScaler implements Progressable {
final ProgressDialogUpdater mWrapped;
final Progressable mWrapped;
final int mFrom, mTo, mMax;
public ProgressScaler(ProgressDialogUpdater wrapped, int from, int to, int max) {
public ProgressScaler(Progressable wrapped, int from, int to, int max) {
this.mWrapped = wrapped;
this.mFrom = from;
this.mTo = to;
@@ -33,7 +36,7 @@ public class ProgressScaler implements ProgressDialogUpdater {
}
/**
* Set progressDialogUpdater of ProgressDialog by sending message to handler on UI thread
* Set progress of ProgressDialog by sending message to handler on UI thread
*/
public void setProgress(String message, int progress, int max) {
mWrapped.setProgress(message, mFrom + progress * (mTo - mFrom) / max, mMax);