-
public final class MediaAttachmentFactory extends AttachmentFactory
An AttachmentFactory that is able to handle Image and Video attachments.
-
-
Field Summary
Fields Modifier and Type Field Description private final Function1<List<Attachment>, Boolean>canHandleprivate final Function3<Modifier, List<Attachment>, Function1<Attachment, Unit>, Unit>previewContentprivate final Function2<Modifier, AttachmentState, Unit>contentprivate final Function1<Attachment, String>textFormatterprivate final AttachmentFactory.Typetype
-
Constructor Summary
Constructors Constructor Description MediaAttachmentFactory(Integer maximumNumberOfPreviewedItems, Boolean skipEnrichUrl, Function8<ManagedActivityResultLauncher<MediaGalleryPreviewContract.Input, MediaGalleryPreviewResult>, Message, Integer, Boolean, DownloadAttachmentUriGenerator, DownloadRequestInterceptor, StreamCdnImageResizing, Boolean, Unit> onContentItemClick, Function1<List<Attachment>, Boolean> canHandle, Function1<String, Unit> itemOverlayContent, Function1<String, Unit> previewItemOverlayContent)Creates a new instance of MediaAttachmentFactory with the default parameters. MediaAttachmentFactory(Integer maximumNumberOfPreviewedItems, Boolean skipEnrichUrl, Function1<MediaAttachmentClickData, Unit> onContentItemClick, Function1<List<Attachment>, Boolean> canHandle, Function1<String, Unit> itemOverlayContent, Function1<String, Unit> previewItemOverlayContent)
-
Method Summary
Modifier and Type Method Description final Function1<List<Attachment>, Boolean>getCanHandle()final Function3<Modifier, List<Attachment>, Function1<Attachment, Unit>, Unit>getPreviewContent()final Function2<Modifier, AttachmentState, Unit>getContent()final Function1<Attachment, String>getTextFormatter()final AttachmentFactory.TypegetType()-
-
Constructor Detail
-
MediaAttachmentFactory
MediaAttachmentFactory(Integer maximumNumberOfPreviewedItems, Boolean skipEnrichUrl, Function8<ManagedActivityResultLauncher<MediaGalleryPreviewContract.Input, MediaGalleryPreviewResult>, Message, Integer, Boolean, DownloadAttachmentUriGenerator, DownloadRequestInterceptor, StreamCdnImageResizing, Boolean, Unit> onContentItemClick, Function1<List<Attachment>, Boolean> canHandle, Function1<String, Unit> itemOverlayContent, Function1<String, Unit> previewItemOverlayContent)
Creates a new instance of MediaAttachmentFactory with the default parameters.
-
MediaAttachmentFactory
MediaAttachmentFactory(Integer maximumNumberOfPreviewedItems, Boolean skipEnrichUrl, Function1<MediaAttachmentClickData, Unit> onContentItemClick, Function1<List<Attachment>, Boolean> canHandle, Function1<String, Unit> itemOverlayContent, Function1<String, Unit> previewItemOverlayContent)
- Parameters:
maximumNumberOfPreviewedItems- The maximum number of thumbnails that can be displayed in a group when previewing Media attachments in the message list.skipEnrichUrl- Used by the media gallery.onContentItemClick- Lambda called when an item gets clicked.canHandle- Lambda that checks if the factory can handle the given attachments.itemOverlayContent- Represents the content overlaid above individual items.previewItemOverlayContent- Represents the content overlaid above individual preview items.
-
-
Method Detail
-
getCanHandle
final Function1<List<Attachment>, Boolean> getCanHandle()
-
getPreviewContent
final Function3<Modifier, List<Attachment>, Function1<Attachment, Unit>, Unit> getPreviewContent()
-
getContent
final Function2<Modifier, AttachmentState, Unit> getContent()
-
getTextFormatter
final Function1<Attachment, String> getTextFormatter()
-
getType
final AttachmentFactory.Type getType()
-
-
-
-