mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-30 14:23:55 +01:00
Fix issue #5831 second part
Add new checking for the display of pause button
This commit is contained in:
parent
f889ed1821
commit
5e6115d5de
1 changed files with 203 additions and 194 deletions
|
|
@ -12,6 +12,7 @@ import fr.free.nrw.commons.R
|
|||
import fr.free.nrw.commons.contributions.Contribution
|
||||
import fr.free.nrw.commons.databinding.FragmentPendingUploadsBinding
|
||||
import fr.free.nrw.commons.di.CommonsDaggerSupportFragment
|
||||
import fr.free.nrw.commons.upload.worker.WorkRequestHelper
|
||||
import fr.free.nrw.commons.utils.DialogUtil.showAlertDialog
|
||||
import fr.free.nrw.commons.utils.ViewUtil
|
||||
import java.util.Locale
|
||||
|
|
@ -105,14 +106,22 @@ class PendingUploadsFragment :
|
|||
binding.pendingUplaodsLl.visibility = View.VISIBLE
|
||||
adapter.submitList(list)
|
||||
binding.progressTextView.setText(contributionsSize.toString() + " uploads left")
|
||||
|
||||
if ((pausedOrQueuedUploads == contributionsSize) || CommonsApplication.isPaused) {
|
||||
//As this function would be triggered multiple times by one tap
|
||||
//Add new checking to enable/ disable the pause button for better UI
|
||||
if (!WorkRequestHelper.Companion.getisUploadWorkerRunning()) {
|
||||
uploadProgressActivity.setPausedIcon(true)
|
||||
}
|
||||
|
||||
} else {
|
||||
if (WorkRequestHelper.Companion.getisUploadWorkerRunning()) {
|
||||
uploadProgressActivity.setPausedIcon(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancels a specific upload after getting a confirmation from the user using Dialog.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue