use of com.fanap.podchat.model.ResultImageFile in project pod-chat-android-sdk by FanapSoft.
the class PodUploader method generateImageUploadResultForSendMessage.
public static ChatResponse<ResultImageFile> generateImageUploadResultForSendMessage(UploadToPodSpaceResult response, String uniqueId, int actualWidth, int actualHeight, int width, int height, String url) {
ResultImageFile result = generateImageUploadResult(response);
ChatResponse<ResultImageFile> chatResponse = new ChatResponse<>();
ResultImageFile resultImageFile = new ResultImageFile();
chatResponse.setUniqueId(uniqueId);
resultImageFile.setId(result.getId());
resultImageFile.setHashCode(result.getHashCode());
resultImageFile.setName(result.getName());
resultImageFile.setHeight(height);
resultImageFile.setWidth(width);
resultImageFile.setActualHeight(actualHeight);
resultImageFile.setActualWidth(actualWidth);
resultImageFile.setUrl(url);
chatResponse.setResult(resultImageFile);
return chatResponse;
}
use of com.fanap.podchat.model.ResultImageFile in project pod-chat-android-sdk by FanapSoft.
the class ChatTest method uploadProgressImage.
@Test
@MediumTest
public void uploadProgressImage() {
sleep(3000);
Uri uri = Uri.parse("content://media/external/images/media/781");
presenter.uploadImageProgress(appContext, activity, uri, new ProgressHandler.onProgress() {
@Override
public void onProgressUpdate(int progress) {
Mockito.anyInt();
}
@Override
public void onFinish(String imageJson, ChatResponse<ResultImageFile> chatResponse) {
}
@Override
public void onError(String jsonError, ErrorOutPut error) {
}
});
}
use of com.fanap.podchat.model.ResultImageFile in project pod-chat-android-sdk by FanapSoft.
the class ChatTestIntegration method uploadProgressImage.
@Test
@MediumTest
public void uploadProgressImage() {
sleep(3000);
Uri uri = Uri.parse("content://media/external/images/media/781");
presenter.uploadImageProgress(appContext, activity, uri, new ProgressHandler.onProgress() {
@Override
public void onProgressUpdate(int progress) {
Mockito.anyInt();
}
@Override
public void onFinish(String imageJson, ChatResponse<ResultImageFile> chatResponse) {
}
@Override
public void onError(String jsonError, ErrorOutPut error) {
}
});
}
use of com.fanap.podchat.model.ResultImageFile in project pod-chat-android-sdk by FanapSoft.
the class ChatTestSandbox method uploadProgressImage.
@Test
@MediumTest
public void uploadProgressImage() {
sleep(3000);
Uri uri = Uri.parse("content://media/external/images/media/781");
presenter.uploadImageProgress(appContext, activity, uri, new ProgressHandler.onProgress() {
@Override
public void onProgressUpdate(int progress) {
Mockito.anyInt();
}
@Override
public void onFinish(String imageJson, ChatResponse<ResultImageFile> chatResponse) {
}
@Override
public void onError(String jsonError, ErrorOutPut error) {
}
});
}
use of com.fanap.podchat.model.ResultImageFile in project pod-chat-android-sdk by FanapSoft.
the class ChatActivity method sendLocationMsg.
private void sendLocationMsg() {
String center = "35.7003510,51.3376472";
String meta = getMetaData();
RequestLocationMessage requestLocationMessage = new RequestLocationMessage.Builder().systemMetadata(meta).center(center).message("Im here now : ) ").setUserGroupHash(TEST_THREAD_HASH).activity(ChatActivity.this).threadId(TEST_THREAD_ID).build();
// presenter.sendLocationMessage(requestLocationMessage);
presenter.sendLocationMessage(requestLocationMessage, new ProgressHandler.sendFileMessage() {
@Override
public void onProgressUpdate(String uniqueId, int progress, int totalBytesSent, int totalBytesToSend) {
Log.d("MTAG", "Update progress: " + "Total Bytes sent: " + totalBytesSent + " Total Bytes left " + totalBytesToSend);
}
@Override
public void onFinishImage(String json, ChatResponse<ResultImageFile> chatResponse) {
Log.d("MTAG", "Finish upload");
}
@Override
public void onError(String jsonError, ErrorOutPut error) {
Log.d("MTAG", "Error upload");
}
});
}
Aggregations