mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-09 22:43:10 +08:00
Make AndroidView an interface
Summary: The current AndroidView stipulates that the backing shadow node can't be a FlatShadowNode. In some cases, however, we want to apply some of the same logic (ex not adding NodeRegions, etc) to other ViewManagers that have a FlatShadowNode backing (and that don't necessarily create a FlatViewGroup). This commit renames AndroidView to NativeViewWrapper, and re-introduces AndroidView as an interface, so that logic for padding, NodeRegions, etc can be shared. Differential Revision: D2942387
This commit is contained in:
@@ -240,11 +240,7 @@ import com.facebook.react.uimanager.events.EventDispatcher;
|
||||
isAndroidView,
|
||||
needsCustomLayoutForChildren);
|
||||
|
||||
// this is a temporary measure to skip adding node regions for RCTTextInput. This will be fixed
|
||||
// in a patch soon which will convert AndroidView into an interface, thus allowing RCTTextInput
|
||||
// to be treated as an AndroidView
|
||||
boolean skipAddingNodeRegion = node instanceof RCTTextInput;
|
||||
if (!isAndroidView && node.isVirtualAnchor() && !skipAddingNodeRegion) {
|
||||
if (!isAndroidView && node.isVirtualAnchor()) {
|
||||
// If RCTText is mounted to View, virtual children will not receive any touch events
|
||||
// because they don't get added to nodeRegions, so nodeRegions will be empty and
|
||||
// FlatViewGroup.reactTagForTouch() will always return RCTText's id. To fix the issue,
|
||||
|
||||
Reference in New Issue
Block a user