LinkAttachmentFactory

constructor(linkDescriptionMaxLines: Int, onItemClick: (LinkAttachmentClickData) -> Unit = { onLinkAttachmentContentClick(it.context, it.url) }, canHandle: (attachments: List<Attachment>) -> Boolean = { links -> links.any { it.hasLink() && !it.isGiphy() } })

Parameters

linkDescriptionMaxLines
  • The limit of how many lines we show for the link description.

onLinkAttachmentContentClick

Lambda called when an item gets clicked.

canHandle

Lambda that checks if the factory can handle the given attachments.


constructor(linkDescriptionMaxLines: Int, onContentItemClick: (context: Context, previewUrl: String) -> Unit, canHandle: (attachments: List<Attachment>) -> Boolean = { links -> links.any { it.hasLink() && !it.isGiphy() } })

Deprecated

Use the constructor that does not take onContentItemClick parameter.

Replace with

LinkAttachmentFactory(linkDescriptionMaxLines, onItemClick, canHandle)

Creates a new instance of LinkAttachmentFactory with the default parameters.