From 04d6b2a6b9b682b8b4f6338d2759b2184aa8bb93 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Wed, 17 Jul 2024 12:31:18 -0600 Subject: [PATCH] Fix paused download UI bug when adapter is refreshed --- .../lagradost/cloudstream3/ui/download/DownloadAdapter.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadAdapter.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadAdapter.kt index 255e9ffd..ac45a476 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadAdapter.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadAdapter.kt @@ -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,