mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-04 10:55:04 +08:00
backout update of css-layout. breaks ios <9
Reviewed By: javache Differential Revision: D3164127 fb-gh-sync-id: 3926430f365711466ba93cd2eb7c91f31ef0c7f8 fbshipit-source-id: 3926430f365711466ba93cd2eb7c91f31ef0c7f8
This commit is contained in:
committed by
Facebook Github Bot 3
parent
7f56073b25
commit
8ef551174b
@@ -11,7 +11,6 @@ package com.facebook.react.views.art;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
|
||||
import com.facebook.csslayout.CSSMeasureMode;
|
||||
import com.facebook.csslayout.CSSNode;
|
||||
import com.facebook.csslayout.MeasureOutput;
|
||||
import com.facebook.react.uimanager.BaseViewManager;
|
||||
@@ -28,13 +27,7 @@ public class ARTSurfaceViewManager extends
|
||||
|
||||
private static final CSSNode.MeasureFunction MEASURE_FUNCTION = new CSSNode.MeasureFunction() {
|
||||
@Override
|
||||
public void measure(
|
||||
CSSNode node,
|
||||
float width,
|
||||
CSSMeasureMode widthMode,
|
||||
float height,
|
||||
CSSMeasureMode heightMode,
|
||||
MeasureOutput measureOutput) {
|
||||
public void measure(CSSNode node, float width, float height, MeasureOutput measureOutput) {
|
||||
throw new IllegalStateException("SurfaceView should have explicit width and height set");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -19,7 +19,6 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import com.facebook.csslayout.CSSMeasureMode;
|
||||
import com.facebook.csslayout.CSSNode;
|
||||
import com.facebook.csslayout.MeasureOutput;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
@@ -52,13 +51,7 @@ public class ProgressBarShadowNode extends LayoutShadowNode implements CSSNode.M
|
||||
}
|
||||
|
||||
@Override
|
||||
public void measure(
|
||||
CSSNode node,
|
||||
float width,
|
||||
CSSMeasureMode widthMode,
|
||||
float height,
|
||||
CSSMeasureMode heightMode,
|
||||
MeasureOutput measureOutput) {
|
||||
public void measure(CSSNode node, float width, float height, MeasureOutput measureOutput) {
|
||||
final int style = ReactProgressBarViewManager.getStyleFromString(getStyle());
|
||||
if (!mMeasured.contains(style)) {
|
||||
ProgressBar progressBar = ReactProgressBarViewManager.createProgressBar(getThemedContext(), style);
|
||||
|
||||
@@ -15,7 +15,6 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.SeekBar;
|
||||
|
||||
import com.facebook.csslayout.CSSMeasureMode;
|
||||
import com.facebook.csslayout.CSSNode;
|
||||
import com.facebook.csslayout.MeasureOutput;
|
||||
import com.facebook.react.bridge.ReactContext;
|
||||
@@ -51,13 +50,7 @@ public class ReactSliderManager extends SimpleViewManager<ReactSlider> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void measure(
|
||||
CSSNode node,
|
||||
float width,
|
||||
CSSMeasureMode widthMode,
|
||||
float height,
|
||||
CSSMeasureMode heightMode,
|
||||
MeasureOutput measureOutput) {
|
||||
public void measure(CSSNode node, float width, float height, MeasureOutput measureOutput) {
|
||||
if (!mMeasured) {
|
||||
SeekBar reactSlider = new ReactSlider(getThemedContext(), null, STYLE);
|
||||
final int spec = View.MeasureSpec.makeMeasureSpec(
|
||||
|
||||
@@ -14,7 +14,6 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CompoundButton;
|
||||
|
||||
import com.facebook.csslayout.CSSMeasureMode;
|
||||
import com.facebook.csslayout.CSSNode;
|
||||
import com.facebook.csslayout.MeasureOutput;
|
||||
import com.facebook.react.bridge.ReactContext;
|
||||
@@ -45,13 +44,7 @@ public class ReactSwitchManager extends SimpleViewManager<ReactSwitch> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void measure(
|
||||
CSSNode node,
|
||||
float width,
|
||||
CSSMeasureMode widthMode,
|
||||
float height,
|
||||
CSSMeasureMode heightMode,
|
||||
MeasureOutput measureOutput) {
|
||||
public void measure(CSSNode node, float width, float height, MeasureOutput measureOutput) {
|
||||
if (!mMeasured) {
|
||||
// Create a switch with the default config and measure it; since we don't (currently)
|
||||
// support setting custom switch text, this is fine, as all switches will measure the same
|
||||
|
||||
@@ -28,7 +28,6 @@ import android.text.style.ForegroundColorSpan;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.facebook.csslayout.CSSConstants;
|
||||
import com.facebook.csslayout.CSSMeasureMode;
|
||||
import com.facebook.csslayout.CSSNode;
|
||||
import com.facebook.csslayout.MeasureOutput;
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
@@ -194,13 +193,7 @@ public class ReactTextShadowNode extends LayoutShadowNode {
|
||||
private static final CSSNode.MeasureFunction TEXT_MEASURE_FUNCTION =
|
||||
new CSSNode.MeasureFunction() {
|
||||
@Override
|
||||
public void measure(
|
||||
CSSNode node,
|
||||
float width,
|
||||
CSSMeasureMode widthMode,
|
||||
float height,
|
||||
CSSMeasureMode heightMode,
|
||||
MeasureOutput measureOutput) {
|
||||
public void measure(CSSNode node, float width, float height, MeasureOutput measureOutput) {
|
||||
// TODO(5578671): Handle text direction (see View#getTextDirectionHeuristic)
|
||||
ReactTextShadowNode reactCSSNode = (ReactTextShadowNode) node;
|
||||
TextPaint textPaint = sTextPaintInstance;
|
||||
@@ -213,7 +206,8 @@ public class ReactTextShadowNode extends LayoutShadowNode {
|
||||
Layout.getDesiredWidth(text, textPaint) : Float.NaN;
|
||||
|
||||
// technically, width should never be negative, but there is currently a bug in
|
||||
boolean unconstrainedWidth = widthMode == CSSMeasureMode.UNDEFINED || width < 0;
|
||||
// LayoutEngine where a negative value can be passed.
|
||||
boolean unconstrainedWidth = CSSConstants.isUndefined(width) || width < 0;
|
||||
|
||||
if (boring == null &&
|
||||
(unconstrainedWidth ||
|
||||
|
||||
@@ -16,8 +16,6 @@ import android.util.TypedValue;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
|
||||
import com.facebook.csslayout.CSSConstants;
|
||||
import com.facebook.csslayout.CSSMeasureMode;
|
||||
import com.facebook.csslayout.CSSNode;
|
||||
import com.facebook.csslayout.MeasureOutput;
|
||||
import com.facebook.csslayout.Spacing;
|
||||
@@ -65,17 +63,11 @@ public class ReactTextInputShadowNode extends ReactTextShadowNode implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void measure(
|
||||
CSSNode node,
|
||||
float width,
|
||||
CSSMeasureMode widthMode,
|
||||
float height,
|
||||
CSSMeasureMode heightMode,
|
||||
MeasureOutput measureOutput) {
|
||||
public void measure(CSSNode node, float width, float height, MeasureOutput measureOutput) {
|
||||
// measure() should never be called before setThemedContext()
|
||||
EditText editText = Assertions.assertNotNull(mEditText);
|
||||
|
||||
measureOutput.width = widthMode == CSSMeasureMode.UNDEFINED ? CSSConstants.UNDEFINED : width;
|
||||
measureOutput.width = width;
|
||||
editText.setTextSize(
|
||||
TypedValue.COMPLEX_UNIT_PX,
|
||||
mFontSize == UNSET ?
|
||||
|
||||
Reference in New Issue
Block a user