From d82d99c464a66167c9e903dedfdb96b001172dcb Mon Sep 17 00:00:00 2001 From: Kaizen <42545336+Kaizen-7@users.noreply.github.com> Date: Fri, 25 Mar 2022 10:44:12 +0100 Subject: [PATCH] fix: show progress views on corner case --- .../verificaC19/ui/FirstActivity.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/it/ministerodellasalute/verificaC19/ui/FirstActivity.kt b/app/src/main/java/it/ministerodellasalute/verificaC19/ui/FirstActivity.kt index bfdd437c..eeaa7f54 100644 --- a/app/src/main/java/it/ministerodellasalute/verificaC19/ui/FirstActivity.kt +++ b/app/src/main/java/it/ministerodellasalute/verificaC19/ui/FirstActivity.kt @@ -180,9 +180,7 @@ class FirstActivity : AppCompatActivity(), View.OnClickListener, binding.qrButton.background.alpha = 128 binding.resumeDownload.show() binding.dateLastSyncText.text = getString(R.string.incompleteDownload) - binding.chunkCount.show() - binding.chunkSize.show() - binding.updateProgressBar.show() + showDownloadProgressViews() } else { binding.resumeDownload.hide() } @@ -533,9 +531,7 @@ class FirstActivity : AppCompatActivity(), View.OnClickListener, PrefKeys.KEY_TOTAL_CHUNK -> { val totalChunk = viewModel.getTotalChunk().toInt() binding.updateProgressBar.max = totalChunk - binding.updateProgressBar.show() - binding.chunkCount.show() - binding.chunkSize.show() + showDownloadProgressViews() updateDownloadedPackagesCount() Log.i(PrefKeys.KEY_TOTAL_CHUNK, totalChunk.toString()) } @@ -544,6 +540,8 @@ class FirstActivity : AppCompatActivity(), View.OnClickListener, Log.i(PrefKeys.AUTH_TO_RESUME, authToResume.toString()) if (viewModel.getResumeAvailable() == 0L) { binding.resumeDownload.show() + binding.dateLastSyncText.text = getString(R.string.incompleteDownload) + showDownloadProgressViews() binding.qrButton.background.alpha = 128 } }