mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-30 22:12:42 +08:00
Allow FlatShadowNode mouting to its own view
Summary: @public This diff adds a `FlatShadowNode.forceMountToView()` method that will render its contents in it own `View`. Reviewed By: sriramramani Differential Revision: D2564502
This commit is contained in:
committed by
Ahmed El-Helw
parent
7db444c9ae
commit
8de2acd3a9
@@ -23,12 +23,18 @@ import com.facebook.react.uimanager.ViewManagerRegistry;
|
||||
* FlatNativeViewHierarchyManager is the only class that performs View manipulations. All of this
|
||||
* class methods can only be called from UI thread by {@link FlatUIViewOperationQueue}.
|
||||
*/
|
||||
/* package */ final class FlatNativeViewHierarchyManager extends NativeViewHierarchyManager {
|
||||
/* package */ final class FlatNativeViewHierarchyManager extends NativeViewHierarchyManager
|
||||
implements ViewResolver {
|
||||
|
||||
/* package */ FlatNativeViewHierarchyManager(ViewManagerRegistry viewManagers) {
|
||||
super(viewManagers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int reactTag) {
|
||||
return super.resolveView(reactTag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRootView(
|
||||
int tag,
|
||||
@@ -60,6 +66,11 @@ import com.facebook.react.uimanager.ViewManagerRegistry;
|
||||
}
|
||||
}
|
||||
|
||||
/* package */ void updateViewGroup(int reactTag, int[] viewsToAdd, int[] viewsToDetach) {
|
||||
FlatViewGroup view = (FlatViewGroup) resolveView(reactTag);
|
||||
view.mountViews(this, viewsToAdd, viewsToDetach);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates View bounds, possibly re-measuring and re-layouting it if the size changed.
|
||||
*
|
||||
@@ -85,4 +96,11 @@ import com.facebook.react.uimanager.ViewManagerRegistry;
|
||||
view.offsetTopAndBottom(top - view.getTop());
|
||||
}
|
||||
}
|
||||
|
||||
/* package */ void detachAllChildrenFromViews(int[] viewsToDetachAllChildrenFrom) {
|
||||
for (int viewTag : viewsToDetachAllChildrenFrom) {
|
||||
FlatViewGroup viewGroup = (FlatViewGroup) resolveView(viewTag);
|
||||
viewGroup.detachAllViewsFromParent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user