From b103903ec869bc48dfcaf001dc926957d0b5200a Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Wed, 9 Aug 2017 20:32:09 -0700 Subject: [PATCH] Fix updating a view z-index on Android Summary: If the z-index was updated after the initial mount, changes would not be reflected because we did not recalculate the z-index mapped child views and redraw the view. This adds code to do that and call it whenever we update z-index. **Test plan** Tested by reproducing the bug with 2 overlapping views that change z-index every second. Made sure it now works properly and z-index changes are reflected. Closes https://github.com/facebook/react-native/pull/15203 Differential Revision: D5564832 Pulled By: achen1 fbshipit-source-id: 5b6c20147211ce0b7e8954d60f8614eafe128fb4 --- .../facebook/react/uimanager/BaseViewManager.java | 5 +++++ .../react/uimanager/ReactZIndexedViewGroup.java | 6 ++++++ .../uimanager/ViewGroupDrawingOrderHelper.java | 13 +++++++++++++ .../facebook/react/views/view/ReactViewGroup.java | 7 +++++++ 4 files changed, 31 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java index dc3c9dc8f..ba4055eae 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java @@ -5,6 +5,7 @@ package com.facebook.react.uimanager; import android.graphics.Color; import android.os.Build; import android.view.View; +import android.view.ViewParent; import com.facebook.react.R; import com.facebook.react.bridge.ReadableArray; @@ -80,6 +81,10 @@ public abstract class BaseViewManager