mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-02 22:41:18 +08:00
RN: Android Constants for Overflow Style
Summary: Tidies up the hardcoded strings for referencing the `overflow` style values. Also, the `OVERFLOW` case in the optimized view flattening code path is unnecessary because `OVERFLOW` is already in the `LAYOUT_ONLY_PROPS` set. Reviewed By: achen1 Differential Revision: D8690804 fbshipit-source-id: 3befbe93ed761e57e45f9b50e59bffc8a29a407f
This commit is contained in:
committed by
Facebook Github Bot
parent
f090840f45
commit
cfce6ee9d7
@@ -74,6 +74,9 @@ public class ViewProps {
|
||||
public static final String MIN_HEIGHT = "minHeight";
|
||||
public static final String MAX_HEIGHT = "maxHeight";
|
||||
|
||||
public static final String HIDDEN = "hidden";
|
||||
public static final String VISIBLE = "visible";
|
||||
|
||||
public static final String ASPECT_RATIO = "aspectRatio";
|
||||
|
||||
// Props that sometimes may prevent us from collapsing views
|
||||
@@ -254,8 +257,6 @@ public class ViewProps {
|
||||
return map.isNull(BORDER_RIGHT_WIDTH) || map.getDouble(BORDER_RIGHT_WIDTH) == 0d;
|
||||
case BORDER_BOTTOM_WIDTH:
|
||||
return map.isNull(BORDER_BOTTOM_WIDTH) || map.getDouble(BORDER_BOTTOM_WIDTH) == 0d;
|
||||
case OVERFLOW: // We do nothing with this right now.
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ import com.facebook.react.uimanager.ReactZIndexedViewGroup;
|
||||
import com.facebook.react.uimanager.RootView;
|
||||
import com.facebook.react.uimanager.RootViewUtil;
|
||||
import com.facebook.react.uimanager.ViewGroupDrawingOrderHelper;
|
||||
import com.facebook.react.uimanager.ViewProps;
|
||||
import com.facebook.yoga.YogaConstants;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -682,12 +683,12 @@ public class ReactViewGroup extends ViewGroup implements
|
||||
private void dispatchOverflowDraw(Canvas canvas) {
|
||||
if (mOverflow != null) {
|
||||
switch (mOverflow) {
|
||||
case "visible":
|
||||
case ViewProps.VISIBLE:
|
||||
if (mPath != null) {
|
||||
mPath.rewind();
|
||||
}
|
||||
break;
|
||||
case "hidden":
|
||||
case ViewProps.HIDDEN:
|
||||
if (mReactBackgroundDrawable != null) {
|
||||
float left = 0f;
|
||||
float top = 0f;
|
||||
|
||||
Reference in New Issue
Block a user