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.");
}
}
Aggregations