Update progressbar only if it's not indeterminate

Otherwise it can show the wrong value when it goes back to the
non-indeterminate mode (e.g. after a verification failure).
This commit is contained in:
Gabriele M
2017-07-06 23:50:09 +02:00
parent f23bc5e967
commit 8a559103a9
@@ -90,11 +90,13 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
UpdateDownload update = mUpdaterController.getUpdate(downloadId);
viewHolder.mName.setText(update.getName());
viewHolder.mProgressBar.setProgress(update.getProgress());
boolean indeterminate = update.getStatus() == UpdateStatus.STARTING ||
update.getStatus() == UpdateStatus.VERIFYING ||
update.getStatus() == UpdateStatus.INSTALLING;
viewHolder.mProgressBar.setIndeterminate(indeterminate);
if (!indeterminate) {
viewHolder.mProgressBar.setProgress(update.getProgress());
}
if (mUpdaterController.isDownloading(downloadId)) {
setButtonAction(viewHolder.mButton1, Action.PAUSE, downloadId, true);