changed to not save message attachments

to media store when sharing.
fixed using wrong attachment class for vcards (use lowercase on both sides of attachment mime type comparison)
added share button to audio attachment preview
removed old fileprovider that was never used
added content provider to provide mms attachments to external activities using a filename - not mms part id - so they can be saved externally with a proper name
fix bug when re-using attachment viewholder that has previously had text
fixed bug of image attachments always being named 'image' rather than their filename
 added share button to generic file attachment type in compose message list and removed onclick handler for viewing
This commit is contained in:
gavine99
2025-02-03 19:58:40 +11:00
parent 51ba356526
commit 042bbe80a1
14 changed files with 285 additions and 93 deletions
@@ -21,14 +21,14 @@ package dev.octoshrimpy.quik.extensions
import com.google.android.mms.ContentType
import dev.octoshrimpy.quik.model.MmsPart
fun MmsPart.isSmil() = ContentType.APP_SMIL == type
fun MmsPart.isSmil() = ContentType.APP_SMIL.lowercase() == type.lowercase()
fun MmsPart.isImage() = ContentType.isImageType(type)
fun MmsPart.isImage() = ContentType.isImageType(type.lowercase())
fun MmsPart.isVideo() = ContentType.isVideoType(type)
fun MmsPart.isVideo() = ContentType.isVideoType(type.lowercase())
fun MmsPart.isAudio() = ContentType.isAudioType(type)
fun MmsPart.isAudio() = ContentType.isAudioType(type.lowercase())
fun MmsPart.isText() = ContentType.TEXT_PLAIN == type
fun MmsPart.isText() = ContentType.TEXT_PLAIN.lowercase() == type.lowercase()
fun MmsPart.isVCard() = ContentType.TEXT_VCARD == type
fun MmsPart.isVCard() = ContentType.TEXT_VCARD.lowercase() == type.lowercase()
@@ -443,8 +443,8 @@ class MessageRepositoryImpl @Inject constructor(
imageBytesByAttachment.forEach { (attachment, bytes) ->
parts += when (attachment.getType(context) == "image/gif") {
true -> MMSPart("image", ContentType.IMAGE_GIF, bytes)
false -> MMSPart("image", ContentType.IMAGE_JPEG, bytes)
true -> MMSPart(attachment.getName(context), ContentType.IMAGE_GIF, bytes)
false -> MMSPart(attachment.getName(context), ContentType.IMAGE_JPEG, bytes)
}
}