Keep borderless property when forwarding media.
This commit is contained in:
parent
fdc6cbc507
commit
7fb55c0f51
3 changed files with 24 additions and 10 deletions
|
@ -179,6 +179,7 @@ import org.thoughtcrime.securesms.messagerequests.MessageRequestsBottomView;
|
||||||
import org.thoughtcrime.securesms.mms.AttachmentManager;
|
import org.thoughtcrime.securesms.mms.AttachmentManager;
|
||||||
import org.thoughtcrime.securesms.mms.AttachmentManager.MediaType;
|
import org.thoughtcrime.securesms.mms.AttachmentManager.MediaType;
|
||||||
import org.thoughtcrime.securesms.mms.AudioSlide;
|
import org.thoughtcrime.securesms.mms.AudioSlide;
|
||||||
|
import org.thoughtcrime.securesms.mms.DecryptableStreamUriLoader;
|
||||||
import org.thoughtcrime.securesms.mms.GifSlide;
|
import org.thoughtcrime.securesms.mms.GifSlide;
|
||||||
import org.thoughtcrime.securesms.mms.GlideApp;
|
import org.thoughtcrime.securesms.mms.GlideApp;
|
||||||
import org.thoughtcrime.securesms.mms.GlideRequests;
|
import org.thoughtcrime.securesms.mms.GlideRequests;
|
||||||
|
@ -292,6 +293,7 @@ public class ConversationActivity extends PassphraseRequiredActivity
|
||||||
public static final String TEXT_EXTRA = "draft_text";
|
public static final String TEXT_EXTRA = "draft_text";
|
||||||
public static final String MEDIA_EXTRA = "media_list";
|
public static final String MEDIA_EXTRA = "media_list";
|
||||||
public static final String STICKER_EXTRA = "sticker_extra";
|
public static final String STICKER_EXTRA = "sticker_extra";
|
||||||
|
public static final String BORDERLESS_EXTRA = "borderless_extra";
|
||||||
public static final String DISTRIBUTION_TYPE_EXTRA = "distribution_type";
|
public static final String DISTRIBUTION_TYPE_EXTRA = "distribution_type";
|
||||||
public static final String STARTING_POSITION_EXTRA = "starting_position";
|
public static final String STARTING_POSITION_EXTRA = "starting_position";
|
||||||
|
|
||||||
|
@ -1371,9 +1373,11 @@ public class ConversationActivity extends PassphraseRequiredActivity
|
||||||
|
|
||||||
final String draftText = getIntent().getStringExtra(TEXT_EXTRA);
|
final String draftText = getIntent().getStringExtra(TEXT_EXTRA);
|
||||||
final Uri draftMedia = getIntent().getData();
|
final Uri draftMedia = getIntent().getData();
|
||||||
final MediaType draftMediaType = MediaType.from(getIntent().getType());
|
final String draftContentType = getIntent().getType();
|
||||||
|
final MediaType draftMediaType = MediaType.from(draftContentType);
|
||||||
final List<Media> mediaList = getIntent().getParcelableArrayListExtra(MEDIA_EXTRA);
|
final List<Media> mediaList = getIntent().getParcelableArrayListExtra(MEDIA_EXTRA);
|
||||||
final StickerLocator stickerLocator = getIntent().getParcelableExtra(STICKER_EXTRA);
|
final StickerLocator stickerLocator = getIntent().getParcelableExtra(STICKER_EXTRA);
|
||||||
|
final boolean borderless = getIntent().getBooleanExtra(BORDERLESS_EXTRA, false);
|
||||||
|
|
||||||
if (stickerLocator != null && draftMedia != null) {
|
if (stickerLocator != null && draftMedia != null) {
|
||||||
Log.d(TAG, "Handling shared sticker.");
|
Log.d(TAG, "Handling shared sticker.");
|
||||||
|
@ -1381,6 +1385,13 @@ public class ConversationActivity extends PassphraseRequiredActivity
|
||||||
return new SettableFuture<>(false);
|
return new SettableFuture<>(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (draftMedia != null && draftContentType != null && borderless) {
|
||||||
|
SimpleTask.run(getLifecycle(),
|
||||||
|
() -> getKeyboardImageDetails(draftMedia),
|
||||||
|
details -> sendKeyboardImage(draftMedia, draftContentType, details));
|
||||||
|
return new SettableFuture<>(false);
|
||||||
|
}
|
||||||
|
|
||||||
if (!Util.isEmpty(mediaList)) {
|
if (!Util.isEmpty(mediaList)) {
|
||||||
Log.d(TAG, "Handling shared Media.");
|
Log.d(TAG, "Handling shared Media.");
|
||||||
Intent sendIntent = MediaSendActivity.buildEditorIntent(this, mediaList, recipient.get(), draftText, sendButton.getSelectedTransport());
|
Intent sendIntent = MediaSendActivity.buildEditorIntent(this, mediaList, recipient.get(), draftText, sendButton.getSelectedTransport());
|
||||||
|
@ -3079,7 +3090,7 @@ public class ConversationActivity extends PassphraseRequiredActivity
|
||||||
private @Nullable KeyboardImageDetails getKeyboardImageDetails(@NonNull Uri uri) {
|
private @Nullable KeyboardImageDetails getKeyboardImageDetails(@NonNull Uri uri) {
|
||||||
try {
|
try {
|
||||||
Bitmap bitmap = glideRequests.asBitmap()
|
Bitmap bitmap = glideRequests.asBitmap()
|
||||||
.load(uri)
|
.load(new DecryptableStreamUriLoader.DecryptableUri(uri))
|
||||||
.skipMemoryCache(true)
|
.skipMemoryCache(true)
|
||||||
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
||||||
.submit()
|
.submit()
|
||||||
|
|
|
@ -780,6 +780,7 @@ public class ConversationFragment extends LoggingFragment {
|
||||||
Slide slide = mediaMessage.getSlideDeck().getSlides().get(0);
|
Slide slide = mediaMessage.getSlideDeck().getSlides().get(0);
|
||||||
composeIntent.putExtra(Intent.EXTRA_STREAM, slide.getUri());
|
composeIntent.putExtra(Intent.EXTRA_STREAM, slide.getUri());
|
||||||
composeIntent.setType(slide.getContentType());
|
composeIntent.setType(slide.getContentType());
|
||||||
|
composeIntent.putExtra(ConversationActivity.BORDERLESS_EXTRA, slide.isBorderless());
|
||||||
|
|
||||||
if (slide.hasSticker()) {
|
if (slide.hasSticker()) {
|
||||||
composeIntent.putExtra(ConversationActivity.STICKER_EXTRA, slide.asAttachment().getSticker());
|
composeIntent.putExtra(ConversationActivity.STICKER_EXTRA, slide.asAttachment().getSticker());
|
||||||
|
|
|
@ -296,10 +296,12 @@ public class ShareActivity extends PassphraseRequiredActivity
|
||||||
String textExtra = getIntent().getStringExtra(Intent.EXTRA_TEXT);
|
String textExtra = getIntent().getStringExtra(Intent.EXTRA_TEXT);
|
||||||
ArrayList<Media> mediaExtra = getIntent().getParcelableArrayListExtra(ConversationActivity.MEDIA_EXTRA);
|
ArrayList<Media> mediaExtra = getIntent().getParcelableArrayListExtra(ConversationActivity.MEDIA_EXTRA);
|
||||||
StickerLocator stickerExtra = getIntent().getParcelableExtra(ConversationActivity.STICKER_EXTRA);
|
StickerLocator stickerExtra = getIntent().getParcelableExtra(ConversationActivity.STICKER_EXTRA);
|
||||||
|
boolean borderlessExtra = getIntent().getBooleanExtra(ConversationActivity.BORDERLESS_EXTRA, false);
|
||||||
|
|
||||||
intent.putExtra(ConversationActivity.TEXT_EXTRA, textExtra);
|
intent.putExtra(ConversationActivity.TEXT_EXTRA, textExtra);
|
||||||
intent.putExtra(ConversationActivity.MEDIA_EXTRA, mediaExtra);
|
intent.putExtra(ConversationActivity.MEDIA_EXTRA, mediaExtra);
|
||||||
intent.putExtra(ConversationActivity.STICKER_EXTRA, stickerExtra);
|
intent.putExtra(ConversationActivity.STICKER_EXTRA, stickerExtra);
|
||||||
|
intent.putExtra(ConversationActivity.BORDERLESS_EXTRA, borderlessExtra);
|
||||||
|
|
||||||
if (shareData != null && shareData.isForIntent()) {
|
if (shareData != null && shareData.isForIntent()) {
|
||||||
Log.i(TAG, "Shared data is a single file.");
|
Log.i(TAG, "Shared data is a single file.");
|
||||||
|
|
Loading…
Add table
Reference in a new issue