Verified Commit bcf6eceb authored by Jonas L.'s avatar Jonas L.

Fix glitch of the progress during the download from the local network

parent e8c01721
......@@ -122,6 +122,7 @@ class DownloadLocalNetworkPackageService: IntentService("DownloadLocalNetworkPac
override fun onHandleIntent(intent: Intent?) {
val request = intent!!.getParcelableExtra<DownloadLocalNetworkPackageServiceRequest>(EXTRA_REQUEST)
var isRunning = true
try {
runOnUiThread(Runnable {
......@@ -141,11 +142,13 @@ class DownloadLocalNetworkPackageService: IntentService("DownloadLocalNetworkPac
),
object : ProgressListener {
override fun onProgressChanged(progress: Progress) {
progressInternal.value = DownloadLocalNetworkPackageServiceProgress(
projectId = request.projectId,
projectTitle = request.title,
progress = progress
)
if (isRunning) {
progressInternal.value = DownloadLocalNetworkPackageServiceProgress(
projectId = request.projectId,
projectTitle = request.title,
progress = progress
)
}
}
}
)
......@@ -154,6 +157,8 @@ class DownloadLocalNetworkPackageService: IntentService("DownloadLocalNetworkPac
Log.d(LOG_TAG, "receiving failed", ex)
}
} finally {
isRunning = false
runOnUiThread(Runnable {
progressInternal.value = null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment