Skip to content

Commit cfce6ee

Browse files
yungstersfacebook-github-bot
authored andcommitted
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
1 parent f090840 commit cfce6ee

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ public class ViewProps {
7474
public static final String MIN_HEIGHT = "minHeight";
7575
public static final String MAX_HEIGHT = "maxHeight";
7676

77+
public static final String HIDDEN = "hidden";
78+
public static final String VISIBLE = "visible";
79+
7780
public static final String ASPECT_RATIO = "aspectRatio";
7881

7982
// Props that sometimes may prevent us from collapsing views
@@ -254,8 +257,6 @@ public static boolean isLayoutOnly(ReadableMap map, String prop) {
254257
return map.isNull(BORDER_RIGHT_WIDTH) || map.getDouble(BORDER_RIGHT_WIDTH) == 0d;
255258
case BORDER_BOTTOM_WIDTH:
256259
return map.isNull(BORDER_BOTTOM_WIDTH) || map.getDouble(BORDER_BOTTOM_WIDTH) == 0d;
257-
case OVERFLOW: // We do nothing with this right now.
258-
return true;
259260
default:
260261
return false;
261262
}

ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import com.facebook.react.uimanager.RootView;
3838
import com.facebook.react.uimanager.RootViewUtil;
3939
import com.facebook.react.uimanager.ViewGroupDrawingOrderHelper;
40+
import com.facebook.react.uimanager.ViewProps;
4041
import com.facebook.yoga.YogaConstants;
4142
import javax.annotation.Nullable;
4243

@@ -682,12 +683,12 @@ protected void dispatchDraw(Canvas canvas) {
682683
private void dispatchOverflowDraw(Canvas canvas) {
683684
if (mOverflow != null) {
684685
switch (mOverflow) {
685-
case "visible":
686+
case ViewProps.VISIBLE:
686687
if (mPath != null) {
687688
mPath.rewind();
688689
}
689690
break;
690-
case "hidden":
691+
case ViewProps.HIDDEN:
691692
if (mReactBackgroundDrawable != null) {
692693
float left = 0f;
693694
float top = 0f;

0 commit comments

Comments
 (0)