Fix masking issue with multiselect highlighted items.

This commit is contained in:
Alex Hart 2021-06-02 14:34:34 -03:00
parent 39a7dbda94
commit 6e4f002b6d

View file

@ -725,7 +725,7 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
bodyBubble.setQuoteViewProjection(null); bodyBubble.setQuoteViewProjection(null);
bodyBubble.setVideoPlayerProjection(null); bodyBubble.setVideoPlayerProjection(null);
updateBackgroundDrawableProjections(); updateSelectedBackgroundDrawableProjections();
if (eventListener != null && audioViewStub.resolved()) { if (eventListener != null && audioViewStub.resolved()) {
Log.d(TAG, "setMediaAttributes: unregistering voice note callbacks for audio slide " + audioViewStub.get().getAudioSlideUri()); Log.d(TAG, "setMediaAttributes: unregistering voice note callbacks for audio slide " + audioViewStub.get().getAudioSlideUri());
@ -1469,7 +1469,7 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
if (mediaThumbnailStub != null && mediaThumbnailStub.resolved()) { if (mediaThumbnailStub != null && mediaThumbnailStub.resolved()) {
mediaThumbnailStub.get().showThumbnailView(); mediaThumbnailStub.get().showThumbnailView();
bodyBubble.setVideoPlayerProjection(null); bodyBubble.setVideoPlayerProjection(null);
updateBackgroundDrawableProjections(); updateSelectedBackgroundDrawableProjections();
} }
} }
@ -1479,7 +1479,7 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
mediaThumbnailStub.get().hideThumbnailView(); mediaThumbnailStub.get().hideThumbnailView();
mediaThumbnailStub.get().getDrawingRect(thumbnailMaskingRect); mediaThumbnailStub.get().getDrawingRect(thumbnailMaskingRect);
bodyBubble.setVideoPlayerProjection(Projection.relativeToViewWithCommonRoot(mediaThumbnailStub.get(), bodyBubble, null)); bodyBubble.setVideoPlayerProjection(Projection.relativeToViewWithCommonRoot(mediaThumbnailStub.get(), bodyBubble, null));
updateBackgroundDrawableProjections(); updateSelectedBackgroundDrawableProjections();
} }
} }
@ -1558,10 +1558,11 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
projections.add(quoteView.getProjection((ViewGroup) getRootView()).translateX(bodyBubble.getTranslationX())); projections.add(quoteView.getProjection((ViewGroup) getRootView()).translateX(bodyBubble.getTranslationX()));
} }
updateSelectedBackgroundDrawableProjections();
return projections; return projections;
} }
private void updateBackgroundDrawableProjections() { private void updateSelectedBackgroundDrawableProjections() {
Set<Projection> projections = Stream.of(bodyBubble.getProjections()) Set<Projection> projections = Stream.of(bodyBubble.getProjections())
.map(p -> Projection.translateFromDescendantToParentCoords(p, bodyBubble, this)) .map(p -> Projection.translateFromDescendantToParentCoords(p, bodyBubble, this))
.collect(Collectors.toSet()); .collect(Collectors.toSet());
@ -1570,7 +1571,7 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
!hasNoBubble(messageRecord) && !hasNoBubble(messageRecord) &&
bodyBubbleCorners != null) bodyBubbleCorners != null)
{ {
projections.add(Projection.relativeToParent(this, bodyBubble, bodyBubbleCorners).translateX(bodyBubble.getTranslationX())); projections.add(Projection.relativeToParent(this, bodyBubble, bodyBubbleCorners));
} }
backgroundDrawable.setProjections(projections); backgroundDrawable.setProjections(projections);