mirror of
https://github.com/status-im/react-native.git
synced 2025-01-29 18:54:58 +00:00
Rename java API
Summary: Rename java api to new use yoga naming Reviewed By: IanChilds Differential Revision: D4265345
This commit is contained in:
parent
c5eb13facd
commit
009a792804
@ -10,8 +10,8 @@
|
||||
package com.facebook.react.flat;
|
||||
|
||||
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.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.ThemedReactContext;
|
||||
import com.facebook.react.views.art.ARTSurfaceView;
|
||||
@ -21,10 +21,10 @@ import com.facebook.react.views.art.ARTSurfaceView;
|
||||
|
||||
private 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,
|
||||
|
@ -11,7 +11,7 @@ package com.facebook.react.flat;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.facebook.csslayout.CSSNodeAPI;
|
||||
import com.facebook.csslayout.YogaMeasureFunction;
|
||||
import com.facebook.react.uimanager.ReactStylesDiffMap;
|
||||
import com.facebook.react.uimanager.ReactShadowNode;
|
||||
import com.facebook.react.uimanager.ThemedReactContext;
|
||||
@ -28,9 +28,9 @@ import com.facebook.react.uimanager.ViewManager;
|
||||
|
||||
/* package */ NativeViewWrapper(ViewManager viewManager) {
|
||||
ReactShadowNode reactShadowNode = viewManager.createShadowNodeInstance();
|
||||
if (reactShadowNode instanceof CSSNodeAPI.MeasureFunction) {
|
||||
if (reactShadowNode instanceof YogaMeasureFunction) {
|
||||
mReactShadowNode = reactShadowNode;
|
||||
setMeasureFunction((CSSNodeAPI.MeasureFunction) reactShadowNode);
|
||||
setMeasureFunction((YogaMeasureFunction) reactShadowNode);
|
||||
} else {
|
||||
mReactShadowNode = null;
|
||||
}
|
||||
|
@ -18,8 +18,9 @@ import android.view.Gravity;
|
||||
|
||||
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.fbui.textlayoutbuilder.TextLayoutBuilder;
|
||||
import com.facebook.fbui.textlayoutbuilder.glyphwarmer.GlyphWarmerImpl;
|
||||
import com.facebook.react.bridge.JSApplicationIllegalArgumentException;
|
||||
@ -36,7 +37,7 @@ import com.facebook.react.uimanager.annotations.ReactProp;
|
||||
* a) RCTText is not a virtual node, and can be measured and laid out.
|
||||
* b) when no font size is specified, a font size of ViewDefaults#FONT_SIZE_SP is assumed.
|
||||
*/
|
||||
/* package */ final class RCTText extends RCTVirtualText implements CSSNodeAPI.MeasureFunction {
|
||||
/* package */ final class RCTText extends RCTVirtualText implements YogaMeasureFunction {
|
||||
|
||||
// index of left and right in the Layout.Alignment enum since the base values are @hide
|
||||
private static final int ALIGNMENT_LEFT = 3;
|
||||
@ -74,7 +75,7 @@ import com.facebook.react.uimanager.annotations.ReactProp;
|
||||
|
||||
@Override
|
||||
public long measure(
|
||||
CSSNodeAPI node,
|
||||
YogaNodeAPI node,
|
||||
float width,
|
||||
YogaMeasureMode widthMode,
|
||||
float height,
|
||||
@ -84,7 +85,7 @@ import com.facebook.react.uimanager.annotations.ReactProp;
|
||||
if (TextUtils.isEmpty(text)) {
|
||||
// to indicate that we don't have anything to display
|
||||
mText = null;
|
||||
return MeasureOutput.make(0, 0);
|
||||
return YogaMeasureOutput.make(0, 0);
|
||||
} else {
|
||||
mText = text;
|
||||
}
|
||||
@ -109,7 +110,7 @@ import com.facebook.react.uimanager.annotations.ReactProp;
|
||||
mDrawCommand = new DrawTextLayout(layout);
|
||||
}
|
||||
|
||||
return MeasureOutput.make(mDrawCommand.getLayoutWidth(), mDrawCommand.getLayoutHeight());
|
||||
return YogaMeasureOutput.make(mDrawCommand.getLayoutWidth(), mDrawCommand.getLayoutHeight());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,8 +19,9 @@ import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
|
||||
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.uimanager.PixelUtil;
|
||||
import com.facebook.react.uimanager.Spacing;
|
||||
@ -35,7 +36,7 @@ import com.facebook.react.views.view.MeasureUtil;
|
||||
import static com.facebook.react.views.text.ReactTextShadowNode.PROP_TEXT;
|
||||
import static com.facebook.react.views.text.ReactTextShadowNode.UNSET;
|
||||
|
||||
public class RCTTextInput extends RCTVirtualText implements AndroidView, CSSNodeAPI.MeasureFunction {
|
||||
public class RCTTextInput extends RCTVirtualText implements AndroidView, YogaMeasureFunction {
|
||||
|
||||
@Nullable private String mText;
|
||||
private int mJsEventCount = UNSET;
|
||||
@ -76,7 +77,7 @@ public class RCTTextInput extends RCTVirtualText implements AndroidView, CSSNode
|
||||
|
||||
@Override
|
||||
public long measure(
|
||||
CSSNodeAPI node,
|
||||
YogaNodeAPI node,
|
||||
float width,
|
||||
YogaMeasureMode widthMode,
|
||||
float height,
|
||||
@ -102,7 +103,7 @@ public class RCTTextInput extends RCTVirtualText implements AndroidView, CSSNode
|
||||
editText.measure(
|
||||
MeasureUtil.getMeasureSpec(width, widthMode),
|
||||
MeasureUtil.getMeasureSpec(height, heightMode));
|
||||
return MeasureOutput.make(editText.getMeasuredWidth(), editText.getMeasuredHeight());
|
||||
return YogaMeasureOutput.make(editText.getMeasuredWidth(), editText.getMeasuredHeight());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user