GiphyAttachmentFactory

class GiphyAttachmentFactory(giphyInfoType: GiphyInfoType = GiphyInfoType.FIXED_HEIGHT_DOWNSAMPLED, giphySizingMode: GiphySizingMode = GiphySizingMode.ADAPTIVE, contentScale: ContentScale = ContentScale.Crop, onContentItemClick: (context: Context, Url: String) -> Unit = ::onGiphyAttachmentContentClick) : AttachmentFactory

An AttachmentFactory that validates and shows Giphy attachments using GiphyAttachmentContent.

Has no "preview content", given that this attachment only exists after being sent.

Return

Returns an instance of AttachmentFactory that is used to handle Giphys.

Parameters

giphyInfoType

Used to modify the quality and dimensions of the rendered Giphy attachments.

giphySizingMode

Sets the Giphy container sizing strategy. Setting it to automatic makes the container capable of adaptive resizing and ignore StreamDimens.attachmentsContentGiphyWidth and StreamDimens.attachmentsContentGiphyHeight dimensions, however you can still clip maximum dimensions using StreamDimens.attachmentsContentGiphyMaxWidth and StreamDimens.attachmentsContentGiphyMaxHeight. Setting it to fixed size mode will make it respect all given dimensions.

contentScale

Used to determine the way Giphys are scaled inside the Image composable.

onContentItemClick

Lambda called when an item gets clicked.

Constructors

Link copied to clipboard
constructor(giphyInfoType: GiphyInfoType = GiphyInfoType.FIXED_HEIGHT_DOWNSAMPLED, giphySizingMode: GiphySizingMode = GiphySizingMode.ADAPTIVE, contentScale: ContentScale = ContentScale.Crop, onContentItemClick: (context: Context, Url: String) -> Unit = ::onGiphyAttachmentContentClick)

Inherited properties

Link copied to clipboard
val canHandle: (attachments: List<Attachment>) -> Boolean
Link copied to clipboard
val content: @Composable (modifier: Modifier, attachmentState: AttachmentState) -> Unit
Link copied to clipboard
val previewContent: @Composable (modifier: Modifier, attachments: List<Attachment>, onAttachmentRemoved: (Attachment) -> Unit) -> Unit? = null
Link copied to clipboard
val textFormatter: (attachments: Attachment) -> String
Link copied to clipboard