Fix issue with multiselect boundary on photos and other media.

This commit is contained in:
Alex Hart
2026-09-17 11:18:15 -03:00
parent 6e4844c4fb
commit 1687b3b299
2 changed files with 15 additions and 9 deletions
@@ -896,16 +896,20 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
}
}
private static int getProjectionTop(@NonNull View child) {
Projection projection = Projection.relativeToViewRoot(child, null);
int y = (int) projection.getY();
/**
* Multiselect boundaries are drawn by an item decoration, so they are relative to the list
* rather than to the view root.
*/
private int getProjectionTop(@NonNull View child) {
Projection projection = Projection.relativeToParent(this, child, null);
int y = (int) projection.getY() + getTop();
projection.release();
return y;
}
private static int getProjectionBottom(@NonNull View child) {
Projection projection = Projection.relativeToViewRoot(child, null);
int bottom = (int) projection.getY() + projection.getHeight();
private int getProjectionBottom(@NonNull View child) {
Projection projection = Projection.relativeToParent(this, child, null);
int bottom = (int) projection.getY() + projection.getHeight() + getTop();
projection.release();
return bottom;
}
@@ -2653,7 +2657,9 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
return null;
}
return Projection.relativeToViewRoot(bodyBubble, bodyBubbleCorners)
return Projection.relativeToParent(this, bodyBubble, bodyBubbleCorners)
.translateX(getLeft())
.translateY(getTop())
.translateX(bodyBubble.getTranslationX())
.translateX(getTranslationX())
.scale(bodyBubble.getScaleX());
@@ -465,8 +465,8 @@ public final class ConversationUpdateItem extends FrameLayout
}
private int getCollapsedButtonBottom() {
Projection projection = Projection.relativeToViewRoot(collapsedButton, null);
int bottom = (int) projection.getY() + projection.getHeight();
Projection projection = Projection.relativeToParent(this, collapsedButton, null);
int bottom = (int) projection.getY() + projection.getHeight() + getTop();
projection.release();
return bottom;
}