mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-13 22:43:59 +08:00
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
22 lines
577 B
Java
22 lines
577 B
Java
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
package com.facebook.react.uimanager;
|
|
|
|
/**
|
|
* ViewGroup that supports z-index.
|
|
*/
|
|
public interface ReactZIndexedViewGroup {
|
|
/**
|
|
* Determine the index of a child view at {@param index} considering z-index.
|
|
* @param index The child view index
|
|
* @return The child view index considering z-index
|
|
*/
|
|
int getZIndexMappedChildIndex(int index);
|
|
|
|
/**
|
|
* Redraw the view based on updated child z-index. This should be called after updating one of its child
|
|
* z-index.
|
|
*/
|
|
void updateDrawingOrder();
|
|
}
|