Package com.android.repository.api
Interface ProgressIndicator
-
- All Known Implementing Classes:
ConsoleProgressIndicator,DelegatingProgressIndicator,ProgressIndicatorAdapter
public interface ProgressIndicatorA progress indicator and logger. Progress is from 0-1, or indeterminate.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidcancel()Try to cancel this operation.default ProgressIndicatorcreateSubProgress(double max)Creates a new progress indicator that just delegates tothis, except that its[0, 1]progress interval maps tothis's[getFraction()-max].doublegetFraction()booleanisCanceled()booleanisCancellable()booleanisIndeterminate()voidlogError(java.lang.String s)Logs an error.voidlogError(java.lang.String s, java.lang.Throwable e)Logs an error, including a stacktrace.voidlogInfo(java.lang.String s)Logs an info message.default voidlogVerbose(java.lang.String s)voidlogWarning(java.lang.String s)Logs a warning.voidlogWarning(java.lang.String s, java.lang.Throwable e)Logs a warning, including a stacktrace.voidsetCancellable(boolean cancellable)Sets whether the user should be able to cancel this operation.voidsetFraction(double v)Sets how much progress should be shown on the progress bar, between 0 and 1.voidsetIndeterminate(boolean indeterminate)Sets whether this progress indicator should show indeterminate progress.voidsetSecondaryText(java.lang.String s)Sets the secondary text on the progress indicator.voidsetText(java.lang.String s)Sets the main text shown in the progress indicator.
-
-
-
Method Detail
-
setText
void setText(@Nullable java.lang.String s)Sets the main text shown in the progress indicator.
-
isCanceled
boolean isCanceled()
- Returns:
- True if the user has canceled this operation.
-
cancel
void cancel()
Try to cancel this operation.
-
setCancellable
void setCancellable(boolean cancellable)
Sets whether the user should be able to cancel this operation.
-
isCancellable
boolean isCancellable()
- Returns:
- true if the user should be able to cancel this operation.
-
setIndeterminate
void setIndeterminate(boolean indeterminate)
Sets whether this progress indicator should show indeterminate progress.
-
isIndeterminate
boolean isIndeterminate()
- Returns:
- true if this progress indicator is set to show indeterminate progress.
-
setFraction
void setFraction(double v)
Sets how much progress should be shown on the progress bar, between 0 and 1.
-
getFraction
double getFraction()
- Returns:
- The current amount of progress shown on the progress bar, between 0 and 1.
-
setSecondaryText
void setSecondaryText(@Nullable java.lang.String s)Sets the secondary text on the progress indicator.
-
logWarning
void logWarning(@NonNull java.lang.String s)Logs a warning.
-
logWarning
void logWarning(@NonNull java.lang.String s, @Nullable java.lang.Throwable e)Logs a warning, including a stacktrace.
-
logError
void logError(@NonNull java.lang.String s)Logs an error.
-
logError
void logError(@NonNull java.lang.String s, @Nullable java.lang.Throwable e)Logs an error, including a stacktrace.
-
logInfo
void logInfo(@NonNull java.lang.String s)Logs an info message.
-
logVerbose
default void logVerbose(@NonNull java.lang.String s)
-
createSubProgress
default ProgressIndicator createSubProgress(double max)
Creates a new progress indicator that just delegates tothis, except that its[0, 1]progress interval maps tothis's[getFraction()-max]. So for example ifthisis currently at 10% and a sub progress is created withmax = 0.5, when the sub progress is at 50% the parent progress will be at 30%, and when the sub progress is at 100% the parent will be at 50%.
-
-