From e9440508e1c3f721452026662ac32663438ca87c Mon Sep 17 00:00:00 2001 From: Andrei Shikov Date: Mon, 11 Oct 2021 11:53:45 -0700 Subject: [PATCH] Correctly apply elevation barriers to Android views Summary: The elevation barriers that limited view reordering were applied incorrectly, disabling elevation completely for some combinations of views. This change ensures the order of barriers is correct and only disables elevation reorder between the children and not on them. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D31541961 fbshipit-source-id: 2fa4dc6906790053bd4445c841aeda0e2b3830e5 --- .../java/com/facebook/react/views/view/ReactViewGroup.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java index 8bf0f0b4faf..8aedfecf772 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java @@ -766,13 +766,13 @@ public class ReactViewGroup extends ViewGroup child.getElevation() > 0 && ReactFeatureFlags.insertZReorderBarriersOnViewGroupChildren; if (drawWithZ) { - CanvasUtil.enableZ(canvas, false); + CanvasUtil.enableZ(canvas, true); } boolean result = super.drawChild(canvas, child, drawingTime); if (drawWithZ) { - CanvasUtil.enableZ(canvas, true); + CanvasUtil.enableZ(canvas, false); } return result; }