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 {
|
} else {
|
||||||
return top;
|
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 {
|
} 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)) {
|
if (multiselectPart instanceof MultiselectPart.Attachments && hasThumbnail(messageRecord)) {
|
||||||
Projection projection = Projection.relativeToViewRoot(mediaThumbnailStub.require(), null);
|
Projection projection = Projection.relativeToViewRoot(mediaThumbnailStub.require(), null);
|
||||||
return (int) projection.getY();
|
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)) {
|
} else if (multiselectPart instanceof MultiselectPart.Text && hasThumbnail(messageRecord)) {
|
||||||
Projection projection = Projection.relativeToViewRoot(mediaThumbnailStub.require(), null);
|
Projection projection = Projection.relativeToViewRoot(mediaThumbnailStub.require(), null);
|
||||||
return (int) projection.getY() + projection.getHeight();
|
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)) {
|
} else if (hasNoBubble(messageRecord)) {
|
||||||
return getTop();
|
return getTop();
|
||||||
} else {
|
} else {
|
||||||
|
@ -559,6 +574,9 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
|
||||||
if (multiselectPart instanceof MultiselectPart.Attachments && hasThumbnail(messageRecord)) {
|
if (multiselectPart instanceof MultiselectPart.Attachments && hasThumbnail(messageRecord)) {
|
||||||
Projection projection = Projection.relativeToViewRoot(mediaThumbnailStub.require(), null);
|
Projection projection = Projection.relativeToViewRoot(mediaThumbnailStub.require(), null);
|
||||||
return (int) projection.getY() + projection.getHeight();
|
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)) {
|
} else if (hasNoBubble(messageRecord)) {
|
||||||
return getBottom();
|
return getBottom();
|
||||||
} else {
|
} else {
|
||||||
|
|
Ładowanie…
Reference in New Issue