Package 

Class MediaGalleryPreviewViewModel

    • Constructor Detail

      • MediaGalleryPreviewViewModel

        MediaGalleryPreviewViewModel(ChatClient chatClient, ClientState clientState, String messageId, Boolean skipEnrichUrl)
        Parameters:
        chatClient - The low level chat client used for API calls.
        clientState - Used to collect client state information such as the connectivity status.
        messageId - The ID of the message containing the attachments to be previewed.
        skipEnrichUrl - If set to true will skip enriching URLs when you update the message by deleting an attachment contained within it.
    • Method Detail

      • getUser

         final StateFlow<User> getUser()

        The currently logged in user.

      • getMessage

         final Message getMessage()

        Represents the message that we observe to show the UI data.

      • getPromptedAttachment

         final Attachment getPromptedAttachment()

        If an attachment needs a prompt to be shared due to a large file size this value will be non-null.

        You should clear this value once the prompt is removed.

      • setPromptedAttachment

         final Unit setPromptedAttachment(Attachment promptedAttachment)

        If an attachment needs a prompt to be shared due to a large file size this value will be non-null.

        You should clear this value once the prompt is removed.

      • getConnectionState

         final ConnectionState getConnectionState()

        Represent the header title of the gallery screen.

      • toggleMediaOptions

         final Unit toggleMediaOptions(Boolean isShowingOptions)

        Toggles if we're showing the media options menu.

        Parameters:
        isShowingOptions - If we need to show or hide the options.
      • toggleGallery

         final Unit toggleGallery(Boolean isShowingGallery)

        Toggles if we're showing the gallery screen.

        Parameters:
        isShowingGallery - If we need to show or hide the gallery.
      • deleteCurrentMediaAttachment

         final Unit deleteCurrentMediaAttachment(Attachment currentMediaAttachment, Boolean skipEnrichUrl)

        Deletes the current media attachment from the message we're observing, if possible.

        This will in turn update the UI accordingly or finish this screen in case there are no more media attachments to show.

        Parameters:
        currentMediaAttachment - The media attachment to remove from the message we're updating.
        skipEnrichUrl - If set to true will skip enriching URLs when you update the message by deleting an attachment contained within it.