Partial fix for UI updates

This does not fully fix the issue but does prevent a whole diffrent icon from showing first but the progress still has to re-populate
This commit is contained in:
Luna712 2024-07-19 15:13:24 -06:00 committed by GitHub
parent 0319557683
commit 370a01daa1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View file

@ -174,6 +174,10 @@ class DownloadAdapter(
// We need to make sure we restore the correct progress // We need to make sure we restore the correct progress
// when we refresh data in the adapter. // when we refresh data in the adapter.
downloadButton.resetView() downloadButton.resetView()
val drawable = downloadButton.getDrawableFromStatus(status)?.let {
ContextCompat.getDrawable(downloadButton.context, it)
}
downloadButton.statusView.setImageDrawable(drawable)
downloadButton.progressBar.progressDrawable = downloadButton.progressBar.progressDrawable =
ContextCompat.getDrawable( ContextCompat.getDrawable(
downloadButton.context, downloadButton.context,
@ -264,6 +268,10 @@ class DownloadAdapter(
// We need to make sure we restore the correct progress // We need to make sure we restore the correct progress
// when we refresh data in the adapter. // when we refresh data in the adapter.
downloadButton.resetView() downloadButton.resetView()
val drawable = downloadButton.getDrawableFromStatus(status)?.let {
ContextCompat.getDrawable(downloadButton.context, it)
}
downloadButton.statusView.setImageDrawable(drawable)
downloadButton.progressBar.progressDrawable = downloadButton.progressBar.progressDrawable =
ContextCompat.getDrawable( ContextCompat.getDrawable(
downloadButton.context, downloadButton.context,

View file

@ -58,7 +58,7 @@ open class PieFetchButton(context: Context, attributeSet: AttributeSet) :
} }
private var progressBarBackground: View private var progressBarBackground: View
private var statusView: ImageView var statusView: ImageView
open fun onInflate() {} open fun onInflate() {}