mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
RN: Add Support for overflow on Android (Take 2)
Summary: Adds support for the `overflow` style property on React Native for Android. This is the second attempt to do this. See https://github.com/facebook/react-native/commit/6110a4cc75bf8f285ff091cc175b9ebf737f88fc (D8666509) for the first attempt. Similar to the first attempt, this sets `setClipChildren(false)` by default on all `ViewGroup` instances. However, this differs in how it implements `overflow: hidden`. Instead of conditionally setting `setClipChildren`, this manually clips children to the `ViewGroup`'s bounds (which was incidentally what we were doing for background + border radius already). Reviewed By: achen1 Differential Revision: D8690805 fbshipit-source-id: 58757825cd9d138c18c8758918d85b4ca1915f87
This commit is contained in:
committed by
Facebook Github Bot
parent
cfce6ee9d7
commit
b81c8b51fc
@@ -24,7 +24,6 @@ public class ViewProps {
|
||||
public static final String ALIGN_ITEMS = "alignItems";
|
||||
public static final String ALIGN_SELF = "alignSelf";
|
||||
public static final String ALIGN_CONTENT = "alignContent";
|
||||
public static final String OVERFLOW = "overflow";
|
||||
public static final String DISPLAY = "display";
|
||||
public static final String BOTTOM = "bottom";
|
||||
public static final String COLLAPSABLE = "collapsable";
|
||||
@@ -74,9 +73,6 @@ 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
|
||||
@@ -103,6 +99,10 @@ public class ViewProps {
|
||||
public static final String TEXT_DECORATION_LINE = "textDecorationLine";
|
||||
public static final String TEXT_BREAK_STRATEGY = "textBreakStrategy";
|
||||
public static final String OPACITY = "opacity";
|
||||
public static final String OVERFLOW = "overflow";
|
||||
|
||||
public static final String HIDDEN = "hidden";
|
||||
public static final String VISIBLE = "visible";
|
||||
|
||||
public static final String ALLOW_FONT_SCALING = "allowFontScaling";
|
||||
public static final String INCLUDE_FONT_PADDING = "includeFontPadding";
|
||||
@@ -169,7 +169,6 @@ public class ViewProps {
|
||||
FLEX_SHRINK,
|
||||
FLEX_WRAP,
|
||||
JUSTIFY_CONTENT,
|
||||
OVERFLOW,
|
||||
ALIGN_CONTENT,
|
||||
DISPLAY,
|
||||
|
||||
@@ -257,6 +256,8 @@ 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:
|
||||
return map.isNull(OVERFLOW) || VISIBLE.equals(map.getString(OVERFLOW));
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user