fix: prevent crash in audio view

This commit is contained in:
jubb 2021-07-01 13:43:48 +10:00
parent c153ea2acf
commit 8701f68292
3 changed files with 5 additions and 3 deletions

View File

@ -45,7 +45,9 @@ class VoiceMessageView : LinearLayout, AudioSlidePlayer.Listener {
val player = AudioSlidePlayer.createFor(context, audio, this) val player = AudioSlidePlayer.createFor(context, audio, this)
this.player = player this.player = player
isPreparing = true isPreparing = true
if (!audio.isPendingDownload && !audio.isInProgress) {
player.play(0.0) player.play(0.0)
}
voiceMessageViewLoader.isVisible = audio.isPendingDownload voiceMessageViewLoader.isVisible = audio.isPendingDownload
val cornerRadii = MessageBubbleUtilities.calculateRadii(context, isStartOfMessageCluster, isEndOfMessageCluster, message.isOutgoing) val cornerRadii = MessageBubbleUtilities.calculateRadii(context, isStartOfMessageCluster, isEndOfMessageCluster, message.isOutgoing)
cornerMask.setTopLeftRadius(cornerRadii[0]) cornerMask.setTopLeftRadius(cornerRadii[0])

View File

@ -33,7 +33,7 @@ class AttachmentUploadJob(val attachmentID: Long, val threadID: String, val mess
} }
// Settings // Settings
override val maxFailureCount: Int = 20 override val maxFailureCount: Int = 2
companion object { companion object {
val TAG = AttachmentUploadJob::class.simpleName val TAG = AttachmentUploadJob::class.simpleName

View File

@ -22,7 +22,7 @@ class MessageSendJob(val message: Message, val destination: Destination) : Job {
override var id: String? = null override var id: String? = null
override var failureCount: Int = 0 override var failureCount: Int = 0
override val maxFailureCount: Int = 10 override val maxFailureCount: Int = 2
companion object { companion object {
val TAG = MessageSendJob::class.simpleName val TAG = MessageSendJob::class.simpleName