mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-17 13:28:26 +00:00
parent
50c432aaf0
commit
e79ee7803f
@ -138,7 +138,7 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im
|
|||||||
|
|
||||||
mediaUri = getIntent().getData();
|
mediaUri = getIntent().getData();
|
||||||
mediaType = getIntent().getType();
|
mediaType = getIntent().getType();
|
||||||
date = getIntent().getLongExtra(DATE_EXTRA, -1);
|
date = getIntent().getLongExtra(DATE_EXTRA, System.currentTimeMillis());
|
||||||
|
|
||||||
if (recipientId > -1) {
|
if (recipientId > -1) {
|
||||||
recipient = RecipientFactory.getRecipientForId(this, recipientId, true);
|
recipient = RecipientFactory.getRecipientForId(this, recipientId, true);
|
||||||
|
@ -32,13 +32,13 @@ import android.util.Log;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import org.thoughtcrime.securesms.MediaPreviewActivity;
|
||||||
import org.thoughtcrime.securesms.R;
|
import org.thoughtcrime.securesms.R;
|
||||||
import org.thoughtcrime.securesms.components.AudioView;
|
import org.thoughtcrime.securesms.components.AudioView;
|
||||||
import org.thoughtcrime.securesms.components.RemovableMediaView;
|
import org.thoughtcrime.securesms.components.RemovableMediaView;
|
||||||
import org.thoughtcrime.securesms.components.ThumbnailView;
|
import org.thoughtcrime.securesms.components.ThumbnailView;
|
||||||
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
||||||
import org.thoughtcrime.securesms.providers.PersistentBlobProvider;
|
import org.thoughtcrime.securesms.providers.PersistentBlobProvider;
|
||||||
import org.thoughtcrime.securesms.recipients.Recipients;
|
|
||||||
import org.thoughtcrime.securesms.util.MediaUtil;
|
import org.thoughtcrime.securesms.util.MediaUtil;
|
||||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||||
import org.thoughtcrime.securesms.util.concurrent.ListenableFuture.Listener;
|
import org.thoughtcrime.securesms.util.concurrent.ListenableFuture.Listener;
|
||||||
@ -76,6 +76,7 @@ public class AttachmentManager {
|
|||||||
this.attachmentListener = listener;
|
this.attachmentListener = listener;
|
||||||
|
|
||||||
removableMediaView.setRemoveClickListener(new RemoveButtonListener());
|
removableMediaView.setRemoveClickListener(new RemoveButtonListener());
|
||||||
|
thumbnail.setOnClickListener(new ThumbnailClickListener());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clear() {
|
public void clear() {
|
||||||
@ -274,6 +275,23 @@ public class AttachmentManager {
|
|||||||
constraints.canResize(slide.asAttachment());
|
constraints.canResize(slide.asAttachment());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void previewImageDraft(final @NonNull Slide slide) {
|
||||||
|
if (MediaPreviewActivity.isContentTypeSupported(slide.getContentType()) && slide.getThumbnailUri() != null) {
|
||||||
|
Intent intent = new Intent(context, MediaPreviewActivity.class);
|
||||||
|
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
|
intent.setDataAndType(slide.getUri(), slide.getContentType());
|
||||||
|
|
||||||
|
context.startActivity(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ThumbnailClickListener implements View.OnClickListener {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (slide.isPresent()) previewImageDraft(slide.get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private class RemoveButtonListener implements View.OnClickListener {
|
private class RemoveButtonListener implements View.OnClickListener {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user