MediaAttachmentFactory

class MediaAttachmentFactory(maximumNumberOfPreviewedItems: Int = 4, skipEnrichUrl: Boolean = false, onContentItemClick: (mediaGalleryPreviewLauncher: ManagedActivityResultLauncher<MediaGalleryPreviewContract.Input, MediaGalleryPreviewResult?>, message: Message, attachmentPosition: Int, videoThumbnailsEnabled: Boolean, streamCdnImageResizing: StreamCdnImageResizing, skipEnrichUrl: Boolean) -> Unit = ::onMediaAttachmentContentItemClick, itemOverlayContent: @Composable (attachmentType: String?) -> Unit = { attachmentType -> if (attachmentType == AttachmentType.VIDEO) { DefaultItemOverlayContent() } }, previewItemOverlayContent: @Composable (attachmentType: String?) -> Unit = { attachmentType -> if (attachmentType == AttachmentType.VIDEO) { DefaultPreviewItemOverlayContent() } }) : AttachmentFactory

An AttachmentFactory that is able to handle Image and Video attachments.

Parameters

maximumNumberOfPreviewedItems

The maximum number of thumbnails that can be displayed in a group when previewing Media attachments in the message list. Values between 4 and 8 are optimal.

skipEnrichUrl

Used by the media gallery. If set to true will skip enriching URLs when you update the message by deleting an attachment contained within it. Set to false by default.

onContentItemClick

Lambda called when an item gets clicked.

itemOverlayContent

Represents the content overlaid above individual items. By default it is used to display a play button over video previews.

previewItemOverlayContent

Represents the content overlaid above individual preview items. By default it is used to display a play button over video previews.

Constructors

Link copied to clipboard
constructor(maximumNumberOfPreviewedItems: Int = 4, skipEnrichUrl: Boolean = false, onContentItemClick: (mediaGalleryPreviewLauncher: ManagedActivityResultLauncher<MediaGalleryPreviewContract.Input, MediaGalleryPreviewResult?>, message: Message, attachmentPosition: Int, videoThumbnailsEnabled: Boolean, streamCdnImageResizing: StreamCdnImageResizing, skipEnrichUrl: Boolean) -> Unit = ::onMediaAttachmentContentItemClick, itemOverlayContent: @Composable (attachmentType: String?) -> Unit = { attachmentType -> if (attachmentType == AttachmentType.VIDEO) { DefaultItemOverlayContent() } }, previewItemOverlayContent: @Composable (attachmentType: String?) -> Unit = { attachmentType -> if (attachmentType == AttachmentType.VIDEO) { DefaultPreviewItemOverlayContent() } })

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