kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix issue where a document with text would cause a crash and not be multiselectable.
rodzic
8e94ced7b6
commit
7480ea66ec
|
@ -533,8 +533,17 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
|
|||
} else {
|
||||
return top;
|
||||
}
|
||||
} else if (hasDocument(messageRecord)) {
|
||||
Projection documentProjection = Projection.relativeToParent(this, documentViewStub.get(), null);
|
||||
float documentBoundary = documentProjection.getY() + documentProjection.getHeight();
|
||||
|
||||
if (lastYDownRelativeToThis > documentBoundary) {
|
||||
return bottom;
|
||||
} else {
|
||||
return top;
|
||||
}
|
||||
} else {
|
||||
throw new IllegalStateException("Found a situation where we have something other than a thumbnail.");
|
||||
throw new IllegalStateException("Found a situation where we have something other than a thumbnail or a document.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -543,9 +552,15 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
|
|||
if (multiselectPart instanceof MultiselectPart.Attachments && hasThumbnail(messageRecord)) {
|
||||
Projection projection = Projection.relativeToViewRoot(mediaThumbnailStub.require(), null);
|
||||
return (int) projection.getY();
|
||||
} if (multiselectPart instanceof MultiselectPart.Attachments && hasDocument(messageRecord)) {
|
||||
Projection projection = Projection.relativeToViewRoot(documentViewStub.get(), null);
|
||||
return (int) projection.getY();
|
||||
} else if (multiselectPart instanceof MultiselectPart.Text && hasThumbnail(messageRecord)) {
|
||||
Projection projection = Projection.relativeToViewRoot(mediaThumbnailStub.require(), null);
|
||||
return (int) projection.getY() + projection.getHeight();
|
||||
} else if (multiselectPart instanceof MultiselectPart.Text && hasDocument(messageRecord)) {
|
||||
Projection projection = Projection.relativeToViewRoot(documentViewStub.get(), null);
|
||||
return (int) projection.getY() + projection.getHeight();
|
||||
} else if (hasNoBubble(messageRecord)) {
|
||||
return getTop();
|
||||
} else {
|
||||
|
@ -559,6 +574,9 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
|
|||
if (multiselectPart instanceof MultiselectPart.Attachments && hasThumbnail(messageRecord)) {
|
||||
Projection projection = Projection.relativeToViewRoot(mediaThumbnailStub.require(), null);
|
||||
return (int) projection.getY() + projection.getHeight();
|
||||
} else if (multiselectPart instanceof MultiselectPart.Attachments && hasDocument(messageRecord)) {
|
||||
Projection projection = Projection.relativeToViewRoot(documentViewStub.get(), null);
|
||||
return (int) projection.getY() + projection.getHeight();
|
||||
} else if (hasNoBubble(messageRecord)) {
|
||||
return getBottom();
|
||||
} else {
|
||||
|
|
Ładowanie…
Reference in New Issue