Search in sources :

Example 1 with MultiselectCollection

use of org.thoughtcrime.securesms.conversation.mutiselect.MultiselectCollection in project Signal-Android by WhisperSystems.

the class ConversationItem method getMultiselectPartForLatestTouch.

@Override
@NonNull
public MultiselectPart getMultiselectPartForLatestTouch() {
    MultiselectCollection parts = conversationMessage.getMultiselectCollection();
    if (parts.isSingle()) {
        return parts.asSingle().getSinglePart();
    }
    MultiselectPart top = parts.asDouble().getTopPart();
    MultiselectPart bottom = parts.asDouble().getBottomPart();
    if (hasThumbnail(messageRecord)) {
        return isTouchBelowBoundary(mediaThumbnailStub.require()) ? bottom : top;
    } else if (hasDocument(messageRecord)) {
        return isTouchBelowBoundary(documentViewStub.get()) ? bottom : top;
    } else if (hasAudio(messageRecord)) {
        return isTouchBelowBoundary(audioViewStub.get()) ? bottom : top;
    }
    {
        throw new IllegalStateException("Found a situation where we have something other than a thumbnail or a document.");
    }
}
Also used : MultiselectPart(org.thoughtcrime.securesms.conversation.mutiselect.MultiselectPart) MultiselectCollection(org.thoughtcrime.securesms.conversation.mutiselect.MultiselectCollection) NonNull(androidx.annotation.NonNull)

Aggregations

NonNull (androidx.annotation.NonNull)1 MultiselectCollection (org.thoughtcrime.securesms.conversation.mutiselect.MultiselectCollection)1 MultiselectPart (org.thoughtcrime.securesms.conversation.mutiselect.MultiselectPart)1