mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-03 09:22:23 +00:00
Implement new media send flow.
Update our media send flow to allow users to send multiple images/videos at once. This change includes: - New in-app media picker flow. - Ability to caption images and videos. - Image editing tools are made more prominent in the flow. - Some fixes to the image editing tools.
This commit is contained in:
@@ -85,9 +85,7 @@ public class MediaDatabase extends Database {
|
||||
private final long date;
|
||||
private final boolean outgoing;
|
||||
|
||||
// TODO: Make private again
|
||||
public MediaRecord(DatabaseAttachment attachment, @Nullable Address address, long date, boolean outgoing) {
|
||||
// private MediaRecord(DatabaseAttachment attachment, @Nullable Address address, long date, boolean outgoing) {
|
||||
private MediaRecord(DatabaseAttachment attachment, @Nullable Address address, long date, boolean outgoing) {
|
||||
this.attachment = attachment;
|
||||
this.address = address;
|
||||
this.date = date;
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.Manifest;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.MediaStore;
|
||||
import android.support.v4.content.CursorLoader;
|
||||
|
||||
@@ -19,7 +20,19 @@ public class RecentPhotosLoader extends CursorLoader {
|
||||
MediaStore.Images.ImageColumns.DATE_TAKEN,
|
||||
MediaStore.Images.ImageColumns.DATE_MODIFIED,
|
||||
MediaStore.Images.ImageColumns.ORIENTATION,
|
||||
MediaStore.Images.ImageColumns.MIME_TYPE
|
||||
MediaStore.Images.ImageColumns.MIME_TYPE,
|
||||
MediaStore.Images.ImageColumns.BUCKET_ID
|
||||
};
|
||||
|
||||
private static final String[] PROJECTION_16 = new String[] {
|
||||
MediaStore.Images.ImageColumns._ID,
|
||||
MediaStore.Images.ImageColumns.DATE_TAKEN,
|
||||
MediaStore.Images.ImageColumns.DATE_MODIFIED,
|
||||
MediaStore.Images.ImageColumns.ORIENTATION,
|
||||
MediaStore.Images.ImageColumns.MIME_TYPE,
|
||||
MediaStore.Images.ImageColumns.BUCKET_ID,
|
||||
MediaStore.Images.ImageColumns.WIDTH,
|
||||
MediaStore.Images.ImageColumns.HEIGHT
|
||||
};
|
||||
|
||||
private final Context context;
|
||||
@@ -31,9 +44,11 @@ public class RecentPhotosLoader extends CursorLoader {
|
||||
|
||||
@Override
|
||||
public Cursor loadInBackground() {
|
||||
String[] projection = Build.VERSION.SDK_INT >= 16 ? PROJECTION_16 : PROJECTION;
|
||||
|
||||
if (Permissions.hasAll(context, Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
|
||||
return context.getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
|
||||
PROJECTION, null, null,
|
||||
projection, null, null,
|
||||
MediaStore.Images.ImageColumns.DATE_MODIFIED + " DESC");
|
||||
} else {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user