Search in sources :

Example 26 with SlideDeck

use of org.thoughtcrime.securesms.mms.SlideDeck in project Signal-Android by signalapp.

the class ConversationParentFragment method sendVoiceNote.

private void sendVoiceNote(@NonNull Uri uri, long size) {
    boolean forceSms = sendButton.isManualSelection() && sendButton.getSelectedTransport().isSms();
    boolean initiating = threadId == -1;
    int subscriptionId = sendButton.getSelectedTransport().getSimSubscriptionId().or(-1);
    long expiresIn = TimeUnit.SECONDS.toMillis(recipient.get().getExpiresInSeconds());
    AudioSlide audioSlide = new AudioSlide(requireContext(), uri, size, MediaUtil.AUDIO_AAC, true);
    SlideDeck slideDeck = new SlideDeck();
    slideDeck.addSlide(audioSlide);
    ListenableFuture<Void> sendResult = sendMediaMessage(recipient.getId(), forceSms, "", slideDeck, inputPanel.getQuote().orNull(), Collections.emptyList(), Collections.emptyList(), composeText.getMentions(), expiresIn, false, subscriptionId, initiating, true, null);
    sendResult.addListener(new AssertedSuccessListener<Void>() {

        @Override
        public void onSuccess(Void nothing) {
            draftViewModel.deleteBlob(uri);
        }
    });
}
Also used : AudioSlide(org.thoughtcrime.securesms.mms.AudioSlide) SlideDeck(org.thoughtcrime.securesms.mms.SlideDeck) SuppressLint(android.annotation.SuppressLint)

Aggregations

SlideDeck (org.thoughtcrime.securesms.mms.SlideDeck)26 Recipient (org.thoughtcrime.securesms.recipients.Recipient)13 SuppressLint (android.annotation.SuppressLint)11 Context (android.content.Context)8 AudioSlide (org.thoughtcrime.securesms.mms.AudioSlide)8 OutgoingMediaMessage (org.thoughtcrime.securesms.mms.OutgoingMediaMessage)8 OutgoingSecureMediaMessage (org.thoughtcrime.securesms.mms.OutgoingSecureMediaMessage)7 Nullable (androidx.annotation.Nullable)6 WorkerThread (androidx.annotation.WorkerThread)6 ArrayList (java.util.ArrayList)6 Mention (org.thoughtcrime.securesms.database.model.Mention)6 MmsMessageRecord (org.thoughtcrime.securesms.database.model.MmsMessageRecord)6 GifSlide (org.thoughtcrime.securesms.mms.GifSlide)6 ImageSlide (org.thoughtcrime.securesms.mms.ImageSlide)6 Slide (org.thoughtcrime.securesms.mms.Slide)6 StickerSlide (org.thoughtcrime.securesms.mms.StickerSlide)6 OutgoingTextMessage (org.thoughtcrime.securesms.sms.OutgoingTextMessage)6 SpannableString (android.text.SpannableString)5 Attachment (org.thoughtcrime.securesms.attachments.Attachment)5 Contact (org.thoughtcrime.securesms.contactshare.Contact)5