Fix paused download UI bug when adapter is refreshed

This commit is contained in:
Luna712 2024-07-17 12:31:18 -06:00 committed by GitHub
parent ca59982d60
commit 04d6b2a6b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -171,7 +171,9 @@ class DownloadAdapter(
?.let { ContextCompat.getDrawable(downloadButton.context, it) }
downloadHeaderInfo.text = formattedSize
} else {
downloadButton.doSetProgress = true
// We need to make sure we restore the correct progress
// when we refresh data in the adapter.
downloadButton.resetView()
downloadButton.progressBar.progressDrawable =
ContextCompat.getDrawable(
downloadButton.context,
@ -259,7 +261,9 @@ class DownloadAdapter(
downloadChildEpisodeTextExtra.text =
formatShortFileSize(downloadChildEpisodeTextExtra.context, card.totalBytes)
} else {
downloadButton.doSetProgress = true
// We need to make sure we restore the correct progress
// when we refresh data in the adapter.
downloadButton.resetView()
downloadButton.progressBar.progressDrawable =
ContextCompat.getDrawable(
downloadButton.context,