loadImageAttachment

open fun loadImageAttachment(    @NonNull context: Context,     @NonNull intent: Intent,     @Nullable extraKey: String,     needCompress: Boolean,     @Nullable callback: IAttachmentLoaderCallback)

Call this method to load an image presented by com.streamwide.smartms.lib.core.data.item.ImageAttachment.

This method can be executed in a main thread since it is already done in an AsyncTask.

the image can be chosen from gallery ,taken from camera or shared from another application.

The image is saved in internal storage.

Parameters

context

The application context

intent

An intent that contains all necessary data to extract the image attachment.

extraKey

Useful when a custom data (android.net.Uri, file path...) is stored in the intent parameter referenced by an extra key.

needCompress

If true the resolution of the generated image may exceed FHD.

callback

It will be invoked when the image has been successfully loaded or when an error has occurred. Other details are delivered in the IAttachmentLoaderCallback callback.


open fun loadImageAttachment(    @NonNull context: Context,     @Nullable lifecycle: Lifecycle,     @NonNull intent: Intent,     @Nullable extraKey: String,     needCompress: Boolean,     @Nullable callback: IAttachmentLoaderCallback)

Call this method to load an image presented by com.streamwide.smartms.lib.core.data.item.ImageAttachment.

This method can be executed in a main thread since it is already done in an AsyncTask.

the image can be chosen from gallery ,taken from camera or shared from another application.

The image is saved in internal storage.

Parameters

context

The application context

lifecycle

The application lifecycle

intent

An intent that contains all necessary data to extract the image attachment.

extraKey

Useful when a custom data (android.net.Uri, file path...) is stored in the intent parameter referenced by an extra key.

needCompress

If true the resolution of the generated image may exceed FHD.

callback

It will be invoked when the image has been successfully loaded or when an error has occurred. Other details are delivered in the IAttachmentLoaderCallback callback.