DocumentAttachmentPreviewHandler

class DocumentAttachmentPreviewHandler(context: Context, useDocumentGView: Boolean = true) : AttachmentPreviewHandler

Shows a preview for document attachments.

Behavior depends on useDocumentGView:

  • true (default): documents are rendered via Google Docs Viewer.

  • false: text-based files (TXT, HTML) are rendered in-app, others open with an external app.

Set via ChatTheme(useDocumentGView = false).

Constructors

Link copied to clipboard
constructor(context: Context, useDocumentGView: Boolean = true)

Functions

Link copied to clipboard
open override fun canHandle(attachment: Attachment): Boolean

Determines if the current preview handler is responsible for showing preview for the given attachment.

Link copied to clipboard
open override fun handleAttachmentPreview(attachment: Attachment)

Shows a preview for this attachment using the current preview handler.