Class AttachmentPreviewFactoryManager
-
- All Implemented Interfaces:
public final class AttachmentPreviewFactoryManagerA manager for registered attachment preview factories.
-
-
Constructor Summary
Constructors Constructor Description AttachmentPreviewFactoryManager(List<AttachmentPreviewFactory> attachmentPreviewFactories, FallbackAttachmentPreviewFactory fallbackAttachmentPreviewFactory)AttachmentPreviewFactoryManager(List<AttachmentPreviewFactory> attachmentPreviewFactories)AttachmentPreviewFactoryManager()
-
Method Summary
Modifier and Type Method Description final AttachmentPreviewViewHolderonCreateViewHolder(ViewGroup parentView, Integer viewType, Function1<Attachment, Unit> attachmentRemovalListener, MessageComposerViewStyle style)Creates and instantiates a new instance of AttachmentPreviewViewHolder. final IntegergetItemViewType(Attachment attachment)Finds the first factory that is capable of displaying the given attachment and return a view type associated with the factory. -
-
Constructor Detail
-
AttachmentPreviewFactoryManager
AttachmentPreviewFactoryManager(List<AttachmentPreviewFactory> attachmentPreviewFactories, FallbackAttachmentPreviewFactory fallbackAttachmentPreviewFactory)
- Parameters:
attachmentPreviewFactories- The list of ViewHolder factories for attachment preview items.fallbackAttachmentPreviewFactory- The fallback factory that will be used in case there are no other factories that can handle the attachment.
-
AttachmentPreviewFactoryManager
AttachmentPreviewFactoryManager(List<AttachmentPreviewFactory> attachmentPreviewFactories)
- Parameters:
attachmentPreviewFactories- The list of ViewHolder factories for attachment preview items.
-
AttachmentPreviewFactoryManager
AttachmentPreviewFactoryManager()
-
-
Method Detail
-
onCreateViewHolder
final AttachmentPreviewViewHolder onCreateViewHolder(ViewGroup parentView, Integer viewType, Function1<Attachment, Unit> attachmentRemovalListener, MessageComposerViewStyle style)
Creates and instantiates a new instance of AttachmentPreviewViewHolder.
- Parameters:
parentView- The parent container.attachmentRemovalListener- Click listener for the remove attachment button.style- Used to style the various factories.- Returns:
An instance of attachment preview ViewHolder.
-
getItemViewType
final Integer getItemViewType(Attachment attachment)
Finds the first factory that is capable of displaying the given attachment and return a view type associated with the factory.
- Parameters:
attachment- The attachment to display.
-
-
-
-