-
public final class FileAttachmentFactory extends AttachmentFactory
An AttachmentFactory that validates attachments as files and uses FileAttachmentContent to build the UI for the message.
-
-
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 FileAttachmentFactory(Function1<Attachment, Boolean> showFileSize, Function2<List<AttachmentPreviewHandler>, Attachment, Unit> onContentItemClick, Function1<List<Attachment>, Boolean> canHandle)
-
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
-
FileAttachmentFactory
FileAttachmentFactory(Function1<Attachment, Boolean> showFileSize, Function2<List<AttachmentPreviewHandler>, Attachment, Unit> onContentItemClick, Function1<List<Attachment>, Boolean> canHandle)
- 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.
-
-
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()
-
-
-
-