Fix outgoing quote over media.

fork-5.53.8
Alex Hart 2022-06-13 13:05:56 -03:00 zatwierdzone przez Greyson Parrelli
rodzic ce1983a3b1
commit 2412f6f63a
2 zmienionych plików z 22 dodań i 0 usunięć

Wyświetl plik

@ -1993,6 +1993,19 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
colorizerProjections.addAll(projections);
} else if (hasThumbnail(messageRecord) && mediaThumb != null) {
if (hasQuote(messageRecord) && quoteView != null) {
Projection quote = Projection.relativeToParent(coordinateRoot, bodyBubble, bodyBubbleCorners).translateX(bodyBubble.getTranslationX());
int quoteViewTop = (int) quote.getY();
int mediaTop = (int) mediaThumb.getY();
colorizerProjections.add(
quote.insetBottom(quote.getHeight() - (mediaTop - quoteViewTop))
.scale(bodyBubble.getScaleX())
.translateX(translationX)
.translateY(translationY)
);
}
colorizerProjections.add(
bodyBubbleToRoot.insetTop(mediaThumb.getHeight())
.scale(bodyBubble.getScaleX())

Wyświetl plik

@ -131,6 +131,15 @@ public final class Projection {
return set(x, y + boundary, width, height - boundary, newCorners);
}
public @NonNull Projection insetBottom(int boundary) {
Corners newCorners = this.corners == null ? null : new Corners(this.corners.topLeft,
this.corners.topRight,
0,
0);
return set(x, y, width, height - boundary, newCorners);
}
public static @NonNull Projection relativeToParent(@NonNull ViewGroup parent, @NonNull View view, @Nullable Corners corners) {
Rect viewBounds = new Rect();