-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SA429 Cannot save generic files #1391
SA429 Cannot save generic files #1391
Conversation
@@ -132,6 +132,9 @@ class VisibleMessageContentView : ConstraintLayout { | |||
} | |||
|
|||
if (message is MmsMessageRecord) { | |||
|
|||
//if (message.isMediaPending) displaySpinnerDuringAttachmentDownload() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one might be left over from before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed!
@@ -179,6 +182,12 @@ class VisibleMessageContentView : ConstraintLayout { | |||
hideBody = true | |||
// Document attachment | |||
if (contactIsTrusted || message.isOutgoing) { | |||
// Show the progress spinner if the attachment is downloading, otherwise show | |||
// the document icon (and always remove the other, whichever one that is) | |||
binding.documentView.documentViewProgress.visibility = if (message.isMediaPending) { VISIBLE } else { GONE } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can probably push this one into the DocumentView.bind
method, also check out this helper if that makes it easier :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done & tested - all works nicely
@@ -120,6 +119,8 @@ class VisibleMessageView : LinearLayout { | |||
} | |||
// endregion | |||
|
|||
var messagesWeHaveBound = mutableListOf<Long>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this one also a leftover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops
Contributor checklist
Fixes #1234
syntaxDescription
Attempting to download an attachment before the attachment has finished transferring from the network resulted in a toast with an error message being displayed ("Error while saving attachment to storage"). To fix this issue a check is performed about whether an attachment is still downloading or not, and if so and the user attempts to download the file before it's finished a toast says "Please wait until attachment has finished downloading".
Further, a spinner has been added to the message
VisibleMessageContentView
which replaces the generic file icon and animates a spinner during download, then when the attachment download has completed the generic 'file' icon replaces the spinner.All commits in this PR relate to fixing the same issue.