FileAttachmentFactory

class FileAttachmentFactory(showFileSize: (Attachment) -> Boolean = { true }, onContentItemClick: (previewHandlers: List<AttachmentPreviewHandler>, attachment: Attachment) -> Unit = ::onFileAttachmentContentItemClick, val canHandle: (attachments: List<Attachment>) -> Boolean = { attachments -> attachments.any(Attachment::isAnyFileType) }) : AttachmentFactory

An AttachmentFactory that validates attachments as files and uses FileAttachmentContent to build the UI for the message.

Parameters

showFileSize

Lambda that determines whether to show the file size in the attachment content.

onContentItemClick

Lambda called when an item gets clicked.

canHandle

Lambda that checks if the factory can handle the given attachments.

Constructors

Link copied to clipboard
constructor(showFileSize: (Attachment) -> Boolean = { true }, onContentItemClick: (previewHandlers: List<AttachmentPreviewHandler>, attachment: Attachment) -> Unit = ::onFileAttachmentContentItemClick, canHandle: (attachments: List<Attachment>) -> Boolean = { attachments -> attachments.any(Attachment::isAnyFileType) })

Inherited properties

Link copied to clipboard
val canHandle: (attachments: List<Attachment>) -> Boolean
Link copied to clipboard
val content: @Composable (modifier: Modifier, attachmentState: AttachmentState) -> Unit
Link copied to clipboard
val previewContent: @Composable (modifier: Modifier, attachments: List<Attachment>, onAttachmentRemoved: (Attachment) -> Unit) -> Unit? = null
Link copied to clipboard
val textFormatter: (attachments: Attachment) -> String
Link copied to clipboard