Package 

Class DocumentAttachmentPreviewHandler

  • All Implemented Interfaces:
    io.getstream.chat.android.compose.ui.attachments.preview.handler.AttachmentPreviewHandler

    
    public final class DocumentAttachmentPreviewHandler
     implements 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).

    • Method Summary

      Modifier and Type Method Description
      Boolean canHandle(Attachment attachment) Determines if the current preview handler is responsible for showing preview for the given attachment.
      Unit handleAttachmentPreview(Attachment attachment) Shows a preview for this attachment using the current preview handler.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DocumentAttachmentPreviewHandler

        DocumentAttachmentPreviewHandler(Context context, Boolean useDocumentGView)
    • Method Detail

      • canHandle

         Boolean canHandle(Attachment attachment)

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

        Parameters:
        attachment - The attachment we want to show the preview for.
      • handleAttachmentPreview

         Unit handleAttachmentPreview(Attachment attachment)

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

        Parameters:
        attachment - The attachment we want to show the preview for.