Skip to content

Commit

Permalink
RN: Android Constants for Overflow Style
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yungsters authored and facebook-github-bot committed Jun 29, 2018
1 parent f090840 commit cfce6ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -254,8 +257,6 @@ public static boolean isLayoutOnly(ReadableMap map, String prop) {
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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
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;

Expand Down Expand Up @@ -682,12 +683,12 @@ protected void dispatchDraw(Canvas canvas) {
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;
Expand Down

0 comments on commit cfce6ee

Please sign in to comment.