Skip to content

Commit

Permalink
Reverted commit D3811226
Browse files Browse the repository at this point in the history
Reviewed By: astreet

Differential Revision: D3811226

fbshipit-source-id: 8ade5ef6c34e117fb10a000034b9900f8a56087d
  • Loading branch information
bestander authored and Facebook Github Bot 3 committed Sep 7, 2016
1 parent 6fb1495 commit a13e1c4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,19 @@ public ReactRootView(Context context, AttributeSet attrs, int defStyle) {

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int widthMode = MeasureSpec.getMode(widthMeasureSpec);
int heightMode = MeasureSpec.getMode(heightMeasureSpec);

if (widthMode == MeasureSpec.UNSPECIFIED || heightMode == MeasureSpec.UNSPECIFIED) {
throw new IllegalStateException(
"The root catalyst view must have a width and height given to it by it's parent view. " +
"You can do this by specifying MATCH_PARENT or explicit width and height in the " +
"layout. widthMode=" + widthMode + ", heightMode=" + heightMode);
}

setMeasuredDimension(
MeasureSpec.getSize(widthMeasureSpec),
MeasureSpec.getSize(heightMeasureSpec));

mWasMeasured = true;
// Check if we were waiting for onMeasure to attach the root view
Expand Down

0 comments on commit a13e1c4

Please sign in to comment.