Fix color offset on devices with notches.

This commit is contained in:
Alex Hart
2021-10-01 16:09:54 -03:00
committed by Cody Henthorne
parent a385cb0b68
commit 52cfb57d36
9 changed files with 18 additions and 29 deletions

View File

@@ -142,16 +142,6 @@ public final class Projection {
return new Projection(viewBounds.left, viewBounds.top, toProject.getWidth(), toProject.getHeight(), corners);
}
public static @NonNull Projection translateFromRootToDescendantCoords(@NonNull Projection rootProjection, @NonNull View descendant) {
Rect viewBounds = new Rect();
viewBounds.set((int) rootProjection.x, (int) rootProjection.y, (int) rootProjection.x + rootProjection.width, (int) rootProjection.y + rootProjection.height);
((ViewGroup) descendant.getRootView()).offsetRectIntoDescendantCoords(descendant, viewBounds);
return new Projection(viewBounds.left, viewBounds.top, rootProjection.width, rootProjection.height, rootProjection.corners);
}
public static @NonNull Projection translateFromDescendantToParentCoords(@NonNull Projection descendantProjection, @NonNull View descendant, @NonNull ViewGroup parent) {
Rect viewBounds = new Rect();