mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-02 06:45:02 +08:00
Rename java API
Reviewed By: IanChilds Differential Revision: D4265345 fbshipit-source-id: 69ecfd8fac214f86b8b70647b9b909acd83d78b5
This commit is contained in:
committed by
Facebook Github Bot
parent
85ac5fc354
commit
b9cedaefa6
@@ -10,8 +10,8 @@
|
||||
package com.facebook.react.views.art;
|
||||
|
||||
import com.facebook.csslayout.YogaMeasureMode;
|
||||
import com.facebook.csslayout.CSSNodeAPI;
|
||||
import com.facebook.csslayout.MeasureOutput;
|
||||
import com.facebook.csslayout.YogaMeasureFunction;
|
||||
import com.facebook.csslayout.YogaNodeAPI;
|
||||
import com.facebook.react.module.annotations.ReactModule;
|
||||
import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.ThemedReactContext;
|
||||
@@ -26,10 +26,10 @@ public class ARTSurfaceViewManager extends
|
||||
|
||||
protected static final String REACT_CLASS = "ARTSurfaceView";
|
||||
|
||||
private static final CSSNodeAPI.MeasureFunction MEASURE_FUNCTION = new CSSNodeAPI.MeasureFunction() {
|
||||
private static final YogaMeasureFunction MEASURE_FUNCTION = new YogaMeasureFunction() {
|
||||
@Override
|
||||
public long measure(
|
||||
CSSNodeAPI node,
|
||||
YogaNodeAPI node,
|
||||
float width,
|
||||
YogaMeasureMode widthMode,
|
||||
float height,
|
||||
|
||||
@@ -20,8 +20,9 @@ import android.view.ViewGroup;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import com.facebook.csslayout.YogaMeasureMode;
|
||||
import com.facebook.csslayout.CSSNodeAPI;
|
||||
import com.facebook.csslayout.MeasureOutput;
|
||||
import com.facebook.csslayout.YogaMeasureFunction;
|
||||
import com.facebook.csslayout.YogaNodeAPI;
|
||||
import com.facebook.csslayout.YogaMeasureOutput;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
import com.facebook.react.uimanager.annotations.ReactProp;
|
||||
|
||||
@@ -30,7 +31,7 @@ import com.facebook.react.uimanager.annotations.ReactProp;
|
||||
* {@link android.R.attr.progressBarStyle} for possible styles. ReactProgressBarViewManager
|
||||
* manages how this style is applied to the ProgressBar.
|
||||
*/
|
||||
public class ProgressBarShadowNode extends LayoutShadowNode implements CSSNodeAPI.MeasureFunction {
|
||||
public class ProgressBarShadowNode extends LayoutShadowNode implements YogaMeasureFunction {
|
||||
|
||||
private String mStyle = ReactProgressBarViewManager.DEFAULT_STYLE;
|
||||
|
||||
@@ -53,7 +54,7 @@ public class ProgressBarShadowNode extends LayoutShadowNode implements CSSNodeAP
|
||||
|
||||
@Override
|
||||
public long measure(
|
||||
CSSNodeAPI node,
|
||||
YogaNodeAPI node,
|
||||
float width,
|
||||
YogaMeasureMode widthMode,
|
||||
float height,
|
||||
@@ -70,6 +71,6 @@ public class ProgressBarShadowNode extends LayoutShadowNode implements CSSNodeAP
|
||||
mMeasured.add(style);
|
||||
}
|
||||
|
||||
return MeasureOutput.make(mWidth.get(style), mHeight.get(style));
|
||||
return YogaMeasureOutput.make(mWidth.get(style), mHeight.get(style));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,9 @@ import android.view.ViewGroup;
|
||||
import android.widget.SeekBar;
|
||||
|
||||
import com.facebook.csslayout.YogaMeasureMode;
|
||||
import com.facebook.csslayout.CSSNodeAPI;
|
||||
import com.facebook.csslayout.MeasureOutput;
|
||||
import com.facebook.csslayout.YogaMeasureFunction;
|
||||
import com.facebook.csslayout.YogaNodeAPI;
|
||||
import com.facebook.csslayout.YogaMeasureOutput;
|
||||
import com.facebook.react.bridge.ReactContext;
|
||||
import com.facebook.react.common.MapBuilder;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
@@ -39,7 +40,7 @@ public class ReactSliderManager extends SimpleViewManager<ReactSlider> {
|
||||
private static final String REACT_CLASS = "RCTSlider";
|
||||
|
||||
static class ReactSliderShadowNode extends LayoutShadowNode implements
|
||||
CSSNodeAPI.MeasureFunction {
|
||||
YogaMeasureFunction {
|
||||
|
||||
private int mWidth;
|
||||
private int mHeight;
|
||||
@@ -51,7 +52,7 @@ public class ReactSliderManager extends SimpleViewManager<ReactSlider> {
|
||||
|
||||
@Override
|
||||
public long measure(
|
||||
CSSNodeAPI node,
|
||||
YogaNodeAPI node,
|
||||
float width,
|
||||
YogaMeasureMode widthMode,
|
||||
float height,
|
||||
@@ -67,7 +68,7 @@ public class ReactSliderManager extends SimpleViewManager<ReactSlider> {
|
||||
mMeasured = true;
|
||||
}
|
||||
|
||||
return MeasureOutput.make(mWidth, mHeight);
|
||||
return YogaMeasureOutput.make(mWidth, mHeight);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +80,7 @@ public class ReactSliderManager extends SimpleViewManager<ReactSlider> {
|
||||
reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher().dispatchEvent(
|
||||
new ReactSliderEvent(
|
||||
seekbar.getId(),
|
||||
((ReactSlider)seekbar).toRealProgress(progress),
|
||||
((ReactSlider) seekbar).toRealProgress(progress),
|
||||
fromUser));
|
||||
}
|
||||
|
||||
@@ -93,7 +94,7 @@ public class ReactSliderManager extends SimpleViewManager<ReactSlider> {
|
||||
reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher().dispatchEvent(
|
||||
new ReactSlidingCompleteEvent(
|
||||
seekbar.getId(),
|
||||
((ReactSlider)seekbar).toRealProgress(seekbar.getProgress())));
|
||||
((ReactSlider) seekbar).toRealProgress(seekbar.getProgress())));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -15,8 +15,9 @@ import android.view.ViewGroup;
|
||||
import android.widget.CompoundButton;
|
||||
|
||||
import com.facebook.csslayout.YogaMeasureMode;
|
||||
import com.facebook.csslayout.CSSNodeAPI;
|
||||
import com.facebook.csslayout.MeasureOutput;
|
||||
import com.facebook.csslayout.YogaMeasureFunction;
|
||||
import com.facebook.csslayout.YogaNodeAPI;
|
||||
import com.facebook.csslayout.YogaMeasureOutput;
|
||||
import com.facebook.react.bridge.ReactContext;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
import com.facebook.react.uimanager.SimpleViewManager;
|
||||
@@ -33,7 +34,7 @@ public class ReactSwitchManager extends SimpleViewManager<ReactSwitch> {
|
||||
private static final String REACT_CLASS = "AndroidSwitch";
|
||||
|
||||
static class ReactSwitchShadowNode extends LayoutShadowNode implements
|
||||
CSSNodeAPI.MeasureFunction {
|
||||
YogaMeasureFunction {
|
||||
|
||||
private int mWidth;
|
||||
private int mHeight;
|
||||
@@ -45,7 +46,7 @@ public class ReactSwitchManager extends SimpleViewManager<ReactSwitch> {
|
||||
|
||||
@Override
|
||||
public long measure(
|
||||
CSSNodeAPI node,
|
||||
YogaNodeAPI node,
|
||||
float width,
|
||||
YogaMeasureMode widthMode,
|
||||
float height,
|
||||
@@ -64,7 +65,7 @@ public class ReactSwitchManager extends SimpleViewManager<ReactSwitch> {
|
||||
mMeasured = true;
|
||||
}
|
||||
|
||||
return MeasureOutput.make(mWidth, mHeight);
|
||||
return YogaMeasureOutput.make(mWidth, mHeight);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
|
||||
package com.facebook.react.views.text;
|
||||
|
||||
import com.facebook.csslayout.CSSNode;
|
||||
import com.facebook.csslayout.YogaNode;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
/**
|
||||
* Base class for {@link CSSNode}s that represent inline images.
|
||||
* Base class for {@link YogaNode}s that represent inline images.
|
||||
*/
|
||||
public abstract class ReactTextInlineImageShadowNode extends LayoutShadowNode {
|
||||
|
||||
|
||||
@@ -33,8 +33,9 @@ import android.widget.TextView;
|
||||
import com.facebook.csslayout.YogaDirection;
|
||||
import com.facebook.csslayout.YogaConstants;
|
||||
import com.facebook.csslayout.YogaMeasureMode;
|
||||
import com.facebook.csslayout.CSSNodeAPI;
|
||||
import com.facebook.csslayout.MeasureOutput;
|
||||
import com.facebook.csslayout.YogaMeasureFunction;
|
||||
import com.facebook.csslayout.YogaNodeAPI;
|
||||
import com.facebook.csslayout.YogaMeasureOutput;
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
import com.facebook.react.bridge.JSApplicationIllegalArgumentException;
|
||||
import com.facebook.react.bridge.ReadableMap;
|
||||
@@ -218,11 +219,11 @@ public class ReactTextShadowNode extends LayoutShadowNode {
|
||||
return sb;
|
||||
}
|
||||
|
||||
private final CSSNodeAPI.MeasureFunction mTextMeasureFunction =
|
||||
new CSSNodeAPI.MeasureFunction() {
|
||||
private final YogaMeasureFunction mTextMeasureFunction =
|
||||
new YogaMeasureFunction() {
|
||||
@Override
|
||||
public long measure(
|
||||
CSSNodeAPI node,
|
||||
YogaNodeAPI node,
|
||||
float width,
|
||||
YogaMeasureMode widthMode,
|
||||
float height,
|
||||
@@ -279,11 +280,11 @@ public class ReactTextShadowNode extends LayoutShadowNode {
|
||||
|
||||
if (mNumberOfLines != UNSET &&
|
||||
mNumberOfLines < layout.getLineCount()) {
|
||||
return MeasureOutput.make(
|
||||
return YogaMeasureOutput.make(
|
||||
layout.getWidth(),
|
||||
layout.getLineBottom(mNumberOfLines - 1));
|
||||
} else {
|
||||
return MeasureOutput.make(layout.getWidth(), layout.getHeight());
|
||||
return YogaMeasureOutput.make(layout.getWidth(), layout.getHeight());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,8 +18,9 @@ import android.widget.EditText;
|
||||
|
||||
import com.facebook.csslayout.YogaDirection;
|
||||
import com.facebook.csslayout.YogaMeasureMode;
|
||||
import com.facebook.csslayout.CSSNodeAPI;
|
||||
import com.facebook.csslayout.MeasureOutput;
|
||||
import com.facebook.csslayout.YogaMeasureFunction;
|
||||
import com.facebook.csslayout.YogaNodeAPI;
|
||||
import com.facebook.csslayout.YogaMeasureOutput;
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
import com.facebook.react.common.annotations.VisibleForTesting;
|
||||
import com.facebook.react.uimanager.PixelUtil;
|
||||
@@ -34,7 +35,7 @@ import com.facebook.react.views.text.ReactTextUpdate;
|
||||
|
||||
@VisibleForTesting
|
||||
public class ReactTextInputShadowNode extends ReactTextShadowNode implements
|
||||
CSSNodeAPI.MeasureFunction {
|
||||
YogaMeasureFunction {
|
||||
|
||||
private @Nullable EditText mEditText;
|
||||
private @Nullable float[] mComputedPadding;
|
||||
@@ -71,7 +72,7 @@ public class ReactTextInputShadowNode extends ReactTextShadowNode implements
|
||||
|
||||
@Override
|
||||
public long measure(
|
||||
CSSNodeAPI node,
|
||||
YogaNodeAPI node,
|
||||
float width,
|
||||
YogaMeasureMode widthMode,
|
||||
float height,
|
||||
@@ -103,7 +104,7 @@ public class ReactTextInputShadowNode extends ReactTextShadowNode implements
|
||||
MeasureUtil.getMeasureSpec(width, widthMode),
|
||||
MeasureUtil.getMeasureSpec(height, heightMode));
|
||||
|
||||
return MeasureOutput.make(editText.getMeasuredWidth(), editText.getMeasuredHeight());
|
||||
return YogaMeasureOutput.make(editText.getMeasuredWidth(), editText.getMeasuredHeight());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user