From 1687b3b299b02f4929a8380d7e3bf4ad4e4f85c4 Mon Sep 17 00:00:00 2001 From: Alex Hart Date: Thu, 17 Sep 2026 11:18:15 -0300 Subject: [PATCH] Fix issue with multiselect boundary on photos and other media. --- .../conversation/ConversationItem.java | 20 ++++++++++++------- .../conversation/ConversationUpdateItem.java | 4 ++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationItem.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationItem.java index b059f8b160..75de0146f1 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationItem.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationItem.java @@ -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()); diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationUpdateItem.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationUpdateItem.java index eaeac12634..49871cb5e2 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationUpdateItem.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationUpdateItem.java @@ -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; }