Commit 4419d27a authored by Yusuke Iwaki's avatar Yusuke Iwaki Committed by GitHub

Merge branch 'develop' into feature/fresco

parents 26302a31 24b696c0
......@@ -33,12 +33,12 @@ public class FileUploadingHelper extends MethodCallHelper {
.onSuccessTask(CONVERT_TO_JSON_OBJECT);
}
public Task<JSONObject> sendFileMessage(String roomId, String storageType, JSONObject fileObj) {
public Task<Void> sendFileMessage(String roomId, String storageType, JSONObject fileObj) {
return call("sendFileMessage", TIMEOUT_MS, () -> new JSONArray()
.put(roomId)
.put(TextUtils.isEmpty(storageType) ? JSONObject.NULL : storageType)
.put(fileObj))
.onSuccessTask(CONVERT_TO_JSON_OBJECT);
.onSuccessTask(task -> Task.forResult(null));
}
public Task<JSONObject> ufsCreate(String filename, long filesize, String mimeType, String store,
......
package chat.rocket.android.layouthelper.extra_action.upload;
import android.content.Intent;
import android.provider.MediaStore;
import chat.rocket.android.R;
......@@ -16,7 +17,13 @@ public class AudioUploadActionItem extends AbstractUploadActionItem {
Intent intent = new Intent();
intent.setType("audio/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
return Intent.createChooser(intent, "Select Audio to Upload");
Intent recordSoundIntent = new Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION);
Intent chooserIntent = Intent.createChooser(intent, "Select Audio to Upload");
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[] { recordSoundIntent });
return chooserIntent;
}
@Override
......
package chat.rocket.android.layouthelper.extra_action.upload;
import android.content.Intent;
import android.provider.MediaStore;
import chat.rocket.android.R;
......@@ -16,7 +17,14 @@ public class VideoUploadActionItem extends AbstractUploadActionItem {
Intent intent = new Intent();
intent.setType("video/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
return Intent.createChooser(intent, "Select Video to Upload");
Intent recordVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
recordVideoIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0); //low quality.
Intent chooserIntent = Intent.createChooser(intent, "Select Video to Upload");
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[] { recordVideoIntent });
return chooserIntent;
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment