Updated on 2026-08-14

This commit is contained in:
Tangem 2020-04-16 13:19:30 +03:00
parent 8c556e6973
commit 401d3bb5b6

View file

@ -147,21 +147,23 @@ public class WaitSecurityDelayDialog extends DialogFragment {
}
private void setRemainingTimeout(final int msec) {
progressBar.post(() -> {
int progress = WaitSecurityDelayDialog.this.progressBar.getProgress();
if (timer != null) {
// we get delay latency from card for first time - don't change progress by timer, only by card answer
progressBar.setMax(progress + msec);
timer.cancel();
timer = null;
} else {
int newProgress = progressBar.getMax() - msec;
if (newProgress > progress)
progressBar.setProgress(newProgress);
else
if (progressBar != null) {
progressBar.post(() -> {
int progress = WaitSecurityDelayDialog.this.progressBar.getProgress();
if (timer != null) {
// we get delay latency from card for first time - don't change progress by timer, only by card answer
progressBar.setMax(progress + msec);
}
});
timer.cancel();
timer = null;
} else {
int newProgress = progressBar.getMax() - msec;
if (newProgress > progress)
progressBar.setProgress(newProgress);
else
progressBar.setMax(progress + msec);
}
});
}
}
}