Permalink
Browse files

RN: Add Overflow Visible Kill Switch (Android)

Summary:
Adds a kill switch that reverts the default behavior of `overflow` to be hidden again. The intent of this kill switch is to give applications more time to migrate if necessary (e.g. if they are depending on third party packages with native components that are not compatible with `overflow` being visible by default).

To use the flag, simply set:

  import com.facebook.react.views.view.ReactViewGroup;

  // Somewhere in the initialization of your application.
  ReactViewGroup.sDefaultOverflowHidden = true;

Reviewed By: achen1

Differential Revision: D8718963

fbshipit-source-id: 0eb9aee45dfe04e9ae34d86e3bedcd30a185ef82
  • Loading branch information...
yungsters authored and facebook-github-bot committed Jul 3, 2018
1 parent c1831d5 commit bbdc12eda7dec135799b7f4c41fe678180970dd2
Showing with 9 additions and 1 deletion.
  1. +9 −1 ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java
@@ -49,6 +49,11 @@
ReactInterceptingViewGroup, ReactClippingViewGroup, ReactPointerEventsView, ReactHitSlopView,
ReactZIndexedViewGroup {
/**
* Kill switch to make overflow hidden by default. This flag will eventually be removed.
*/
public static boolean sDefaultOverflowHidden;
private static final int ARRAY_CAPACITY_INCREMENT = 12;
private static final int DEFAULT_BACKGROUND_COLOR = Color.TRANSPARENT;
private static final LayoutParams sDefaultLayoutParam = new ViewGroup.LayoutParams(0, 0);
@@ -113,7 +118,10 @@ public void onLayoutChange(
public ReactViewGroup(Context context) {
super(context);
setClipChildren(false);
// TODO: Remove this check after a couple public releases.
if (!sDefaultOverflowHidden) {
setClipChildren(false);
}
mDrawingOrderHelper = new ViewGroupDrawingOrderHelper(this);
}

0 comments on commit bbdc12e

Please sign in to comment.