Chat SDK for Android v1.2.1
agora java chat SDK
Public Member Functions | List of all members
io.agora.chat.ImageMessageBody Class Reference
Inheritance diagram for io.agora.chat.ImageMessageBody:
io.agora.chat.FileMessageBody io.agora.chat.MessageBody

Public Member Functions

 ImageMessageBody (File imageFile)
 
 ImageMessageBody (Uri imageUri)
 
 ImageMessageBody (File imageFile, File thumbnailFile)
 
 ImageMessageBody (Uri imageLocalPath, Uri thumbnailPath)
 
 ImageMessageBody (EMAImageMessageBody body)
 
String getThumbnailUrl ()
 
void setThumbnailUrl (String thumbnailUrl)
 
void setThumbnailSecret (String secret)
 
String getThumbnailSecret ()
 
void setSendOriginalImage (boolean sendOriginalImage)
 
boolean isSendOriginalImage ()
 
int getWidth ()
 
int getHeight ()
 
String getFileName ()
 
long getFileSize ()
 
String thumbnailLocalPath ()
 
Uri thumbnailLocalUri ()
 
void setThumbnailLocalPath (String localPath)
 
void setThumbnailLocalPath (Uri localPath)
 
void setThumbnailSize (int width, int height)
 
EMDownloadStatus thumbnailDownloadStatus ()
 
void setThumbnailDownloadStatus (EMDownloadStatus status)
 
- Public Member Functions inherited from io.agora.chat.FileMessageBody
 FileMessageBody (String localPath)
 
 FileMessageBody (Uri localPath)
 
void setFileName (String fileName)
 
String getLocalUrl ()
 
void setLocalUrl (String localUrl)
 
Uri getLocalUri ()
 
void setLocalUrl (Uri localUrl)
 
String getRemoteUrl ()
 
void setRemoteUrl (String remoteUrl)
 
void setSecret (String secret)
 
String getSecret ()
 
String displayName ()
 
void setFileLength (long length)
 
EMDownloadStatus downloadStatus ()
 
void setDownloadStatus (EMDownloadStatus status)
 
- Public Member Functions inherited from io.agora.chat.MessageBody
long operationTime ()
 
String operatorId ()
 
int operationCount ()
 

Detailed Description

The image message body class.

ImageMessageBody body = new ImageMessageBody(imageFile);
ImageMessageBody(File imageFile)
Definition: ImageMessageBody.java:81

Constructor & Destructor Documentation

◆ ImageMessageBody() [1/5]

io.agora.chat.ImageMessageBody.ImageMessageBody ( File  imageFile)

Creates an image message body with an image file.

Reference: There are five ways to create an image message body as follows:

Creates an image message body with an image file:

Parameters
imageFileThe image message body.

◆ ImageMessageBody() [2/5]

io.agora.chat.ImageMessageBody.ImageMessageBody ( Uri  imageUri)

Creates an image message body with the image URI.

Parameters
imageUriThe image URI.

◆ ImageMessageBody() [3/5]

io.agora.chat.ImageMessageBody.ImageMessageBody ( File  imageFile,
File  thumbnailFile 
)

Creates an image message body with an image and its thumbnail.

Parameters
imageFileThe original image file.
thumbnailFileThe thumbnail image file.

◆ ImageMessageBody() [4/5]

io.agora.chat.ImageMessageBody.ImageMessageBody ( Uri  imageLocalPath,
Uri  thumbnailPath 
)

Creates an image message body with the URI of an image and its thumbnail.

Parameters
imageLocalPathThe original image URI.
thumbnailPathThe thumbnail image URI.

◆ ImageMessageBody() [5/5]

io.agora.chat.ImageMessageBody.ImageMessageBody ( EMAImageMessageBody  body)

Creates an image message body with an EMAImageMessageBody instance.

Parameters
bodyThe EMAImageMessageBody instance.

Member Function Documentation

◆ getFileName()

String io.agora.chat.ImageMessageBody.getFileName ( )

Gets the image file name.

Returns
The image file name.

Reimplemented from io.agora.chat.FileMessageBody.

◆ getFileSize()

long io.agora.chat.ImageMessageBody.getFileSize ( )

Gets the size of the image file.

Returns
The size of the image file.

◆ getHeight()

int io.agora.chat.ImageMessageBody.getHeight ( )

Gets the image height.

Returns
The image height.

◆ getThumbnailSecret()

String io.agora.chat.ImageMessageBody.getThumbnailSecret ( )

Gets the secret to access the thumbnail. A secret is required for verification for thumbnail download.

Returns
The secret to access the thumbnail.

◆ getThumbnailUrl()

String io.agora.chat.ImageMessageBody.getThumbnailUrl ( )

Gets the URL of the thumbnail on the server.

If ChatOptions#setAutoDownloadThumbnail(boolean) is set, the thumbnail will be downloaded from the path specified with thumbnailRemotePath to a local path during message reception.

Returns
The URL of the thumbnail on the server.

◆ getWidth()

int io.agora.chat.ImageMessageBody.getWidth ( )

Gets the image width.

Returns
The image width.

◆ isSendOriginalImage()

boolean io.agora.chat.ImageMessageBody.isSendOriginalImage ( )

Gets whether to send the original image.

Returns
Whether to send the original image. -(Default)false: Send the thumbnail(image with size larger than 100k will be compressed);
  • true: Send the original image.

◆ setSendOriginalImage()

void io.agora.chat.ImageMessageBody.setSendOriginalImage ( boolean  sendOriginalImage)

Sets whether to send the original image when sending an image.

Parameters
sendOriginalImageWhether to send the original image. -(Default)false: Send the thumbnail(image with size larger than 100k will be compressed);
  • true: Send the original image.

◆ setThumbnailDownloadStatus()

void io.agora.chat.ImageMessageBody.setThumbnailDownloadStatus ( EMDownloadStatus  status)

Sets the download status of the thumbnail in the local database.

Parameters
statusThe download status of the thumbnail.

◆ setThumbnailLocalPath() [1/2]

void io.agora.chat.ImageMessageBody.setThumbnailLocalPath ( String  localPath)

Sets the local path of the thumbnail as a string.

Parameters
localPathThe local path of the thumbnail as a string.

◆ setThumbnailLocalPath() [2/2]

void io.agora.chat.ImageMessageBody.setThumbnailLocalPath ( Uri  localPath)

Sets the local path of the thumbnail as a URI.

Parameters
localPathThe local path of the thumbnail as a URI.

◆ setThumbnailSecret()

void io.agora.chat.ImageMessageBody.setThumbnailSecret ( String  secret)

Sets the secret to access the thumbnail. A secret is required for verification for thumbnail download.

Parameters
secretThe secret to access the thumbnail.

◆ setThumbnailSize()

void io.agora.chat.ImageMessageBody.setThumbnailSize ( int  width,
int  height 
)

Sets the width and height of the thumbnail image.

Parameters
widthThe width of thumbnail.
heightThe height of thumbnail.

◆ setThumbnailUrl()

void io.agora.chat.ImageMessageBody.setThumbnailUrl ( String  thumbnailUrl)

Sets the URL of the thumbnail on the server.

Parameters
thumbnailUrlThe URL of the thumbnail on the server.

◆ thumbnailDownloadStatus()

EMDownloadStatus io.agora.chat.ImageMessageBody.thumbnailDownloadStatus ( )

Gets the download status of the thumbnail.

Returns
The download status of the thumbnail.

◆ thumbnailLocalPath()

String io.agora.chat.ImageMessageBody.thumbnailLocalPath ( )

Gets the local path or the URI of the thumbnail as a string.

Returns
The local path or the URI of the thumbnail as a string.

◆ thumbnailLocalUri()

Uri io.agora.chat.ImageMessageBody.thumbnailLocalUri ( )

Gets the local path of the thumbnail as a URI.

Returns
The local path of the thumbnail as a URI.

The documentation for this class was generated from the following file: