agora_chat_SDK  3.8.2
agorajavachatSDK
Public Member Functions | Static Public Attributes | 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)
 
String toString ()
 
int describeContents ()
 
void writeToParcel (Parcel dest, int flags)
 
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 ()
 
- Public Member Functions inherited from io.agora.chat.FileMessageBody
 FileMessageBody (String localPath)
 
 FileMessageBody (Uri localPath)
 
 FileMessageBody (EMAFileMessageBody body)
 
String getFileName ()
 
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)
 

Static Public Attributes

static final Parcelable.Creator< ImageMessageBodyCREATOR
 

Detailed Description

Image message body class

    ImageMessageBody body = new ImageMessageBody(imageFile);

Constructor & Destructor Documentation

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

Create a image message body

Parameters
imageFileThe image file
io.agora.chat.ImageMessageBody.ImageMessageBody ( Uri  imageUri)

Create a image message body

Parameters
imageUriThe image uri
io.agora.chat.ImageMessageBody.ImageMessageBody ( File  imageFile,
File  thumbnailFile 
)

Create a image message body with original image, and also upload thumbnail to server

Parameters
imageFileThe original image file
thumbnailFileThe thumbnail image file
io.agora.chat.ImageMessageBody.ImageMessageBody ( Uri  imageLocalPath,
Uri  thumbnailPath 
)

create a image message body with original image, but also upload thumbnail to server

Parameters
imageLocalPathThe original image uri
thumbnailPathThe thumbnail image uri

Member Function Documentation

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

Get image file name

Returns
Image file name
long io.agora.chat.ImageMessageBody.getFileSize ( )

Get the image file length

Returns
Image file length
int io.agora.chat.ImageMessageBody.getHeight ( )

Get image height

Returns
Image height
String io.agora.chat.ImageMessageBody.getThumbnailSecret ( )

Get the thumbnail's token

Returns
Thumbnail's token
String io.agora.chat.ImageMessageBody.getThumbnailUrl ( )

Server url path of thumbnail If has set ChatOptions#setAutoDownloadThumbnail(boolean), image receiver will get thumbnail stored under thumbnailRemotePath after a successful download automatically

Returns
The thumbnail's remote url
int io.agora.chat.ImageMessageBody.getWidth ( )

Get image width

Returns
Image width
boolean io.agora.chat.ImageMessageBody.isSendOriginalImage ( )

Get whether to send original image

Returns
Whether to send original image
void io.agora.chat.ImageMessageBody.setSendOriginalImage ( boolean  sendOriginalImage)

Set whether to send original image when sending image, the default is to send the figure after the compression(image greater than 100k will be compress)

Parameters
sendOriginalImageWhether to send original image
void io.agora.chat.ImageMessageBody.setThumbnailLocalPath ( String  localPath)

Set local path of thumbnail

Parameters
localPathLocal path of thumbnail
void io.agora.chat.ImageMessageBody.setThumbnailLocalPath ( Uri  localPath)

Set local Uri of thumbnail

Parameters
localPathLocal Uri of thumbnail
void io.agora.chat.ImageMessageBody.setThumbnailSecret ( String  secret)

Set the thumbnail's token

Parameters
secretThumbnail's token
void io.agora.chat.ImageMessageBody.setThumbnailSize ( int  width,
int  height 
)

Set the width and height of the thumbnail image

Parameters
widthThe width of thumbnail
heightThe height of thumbnail
void io.agora.chat.ImageMessageBody.setThumbnailUrl ( String  thumbnailUrl)

Set the thumbnail's remote url

Parameters
thumbnailUrlThe thumbnail's remote url
EMDownloadStatus io.agora.chat.ImageMessageBody.thumbnailDownloadStatus ( )

Get the download status of the thumbnail

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

Get local path of thumbnail or the String from of Uri

Returns
Local path of thumbnail or the String from of Uri
Uri io.agora.chat.ImageMessageBody.thumbnailLocalUri ( )

Get local Uri of image thumbnail

Returns
Local Uri of image thumbnail

Member Data Documentation

final Parcelable.Creator<ImageMessageBody> io.agora.chat.ImageMessageBody.CREATOR
static
Initial value:
= new Parcelable.Creator<ImageMessageBody>() {
public ImageMessageBody createFromParcel(Parcel in) {
return new ImageMessageBody(in);
}
public ImageMessageBody[] newArray(int size) {
return new ImageMessageBody[size];
}
}

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