Class MediaAttachmentPreviewFactory
-
- All Implemented Interfaces:
-
io.getstream.chat.android.ui.feature.messages.composer.attachment.preview.factory.AttachmentPreviewFactory
public final class MediaAttachmentPreviewFactory implements AttachmentPreviewFactory
The default AttachmentPreviewFactory for image and video attachments.
-
-
Constructor Summary
Constructors Constructor Description MediaAttachmentPreviewFactory()
-
Method Summary
Modifier and Type Method Description BooleancanHandle(Attachment attachment)Checks if the factory can create a preview ViewHolder for this attachment. AttachmentPreviewViewHolderonCreateViewHolder(ViewGroup parentView, Function1<Attachment, Unit> attachmentRemovalListener, MessageComposerViewStyle style)Creates and instantiates a new instance of MediaAttachmentPreviewFactory. -
-
Method Detail
-
canHandle
Boolean canHandle(Attachment attachment)
Checks if the factory can create a preview ViewHolder for this attachment.
- Parameters:
attachment- The attachment we want to show a preview for.- Returns:
True if the factory is able to provide a preview for the given Attachment.
-
onCreateViewHolder
AttachmentPreviewViewHolder onCreateViewHolder(ViewGroup parentView, Function1<Attachment, Unit> attachmentRemovalListener, MessageComposerViewStyle style)
Creates and instantiates a new instance of MediaAttachmentPreviewFactory.
- Parameters:
parentView- The parent container.attachmentRemovalListener- Click listener for the remove attachment button.style- Used to style the factory.- Returns:
An instance of attachment preview ViewHolder.
-
-
-
-