Skip to content

Commit

Permalink
Remove ReactRootView's MeasureSpec assertion
Browse files Browse the repository at this point in the history
Reviewed By: astreet

Differential Revision: D3811226

fbshipit-source-id: 611e5a2960928c19d93823616d68aa11a9786bf6
  • Loading branch information
ayc1 authored and Facebook Github Bot 4 committed Sep 6, 2016
1 parent 4f89fa9 commit 300cb03
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java
Expand Up @@ -80,19 +80,7 @@ public ReactRootView(Context context, AttributeSet attrs, int defStyle) {

@Override
protected void onMeasure(int widthMeasureSpec, int 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));
super.onMeasure(widthMeasureSpec, heightMeasureSpec);

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

0 comments on commit 300cb03

Please sign in to comment.