mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-07 22:40:55 +08:00
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
38 lines
924 B
Java
38 lines
924 B
Java
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
|
|
package com.facebook.react.flat;
|
|
|
|
import com.facebook.csslayout.Spacing;
|
|
|
|
interface AndroidView {
|
|
|
|
/**
|
|
* Whether or not custom layout is needed for the children
|
|
* @return a boolean representing whether custom layout is needed
|
|
*/
|
|
boolean needsCustomLayoutForChildren();
|
|
|
|
/**
|
|
* Did the padding change
|
|
* @return a boolean representing whether the padding changed
|
|
*/
|
|
boolean isPaddingChanged();
|
|
|
|
/**
|
|
* Reset the padding changed internal state
|
|
*/
|
|
void resetPaddingChanged();
|
|
|
|
/**
|
|
* Get this node's padding, as defined by style + default padding.
|
|
*/
|
|
Spacing getPadding();
|
|
}
|