mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-15 23:03:58 +08:00
Implement layout constraint when measuring text
Summary: This diff adds support for layout constraint when measuring text Reviewed By: shergin Differential Revision: D13111434 fbshipit-source-id: 0c8689e9ac8ce2281b03386f275d2a8e034f88d8
This commit is contained in:
committed by
Facebook Github Bot
parent
2dbe769c5a
commit
8367fa9644
@@ -18,6 +18,7 @@ import com.facebook.react.touch.ReactInterceptingViewGroup;
|
||||
import com.facebook.react.uimanager.annotations.ReactProp;
|
||||
import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
||||
import com.facebook.react.uimanager.annotations.ReactPropertyHolder;
|
||||
import com.facebook.yoga.YogaMeasureMode;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -218,9 +219,9 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode>
|
||||
ReadableNativeMap localData,
|
||||
ReadableNativeMap props,
|
||||
float width,
|
||||
int widthMode,
|
||||
YogaMeasureMode widthMode,
|
||||
float height,
|
||||
int heightMode) {
|
||||
YogaMeasureMode heightMode) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,18 @@ package com.facebook.react.views.text;
|
||||
|
||||
import android.text.Layout;
|
||||
import android.text.Spannable;
|
||||
import com.facebook.react.common.MapBuilder;
|
||||
import com.facebook.react.bridge.ReactContext;
|
||||
import com.facebook.react.bridge.ReadableArray;
|
||||
import com.facebook.react.bridge.ReadableMap;
|
||||
import com.facebook.react.bridge.ReadableNativeMap;
|
||||
import com.facebook.react.common.MapBuilder;
|
||||
import com.facebook.react.common.annotations.VisibleForTesting;
|
||||
import com.facebook.react.module.annotations.ReactModule;
|
||||
import com.facebook.react.uimanager.ReactStylesDiffMap;
|
||||
import com.facebook.react.uimanager.ThemedReactContext;
|
||||
import com.facebook.yoga.YogaMeasureMode;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Nullable;
|
||||
import com.facebook.yoga.YogaMeasureMode;
|
||||
|
||||
/**
|
||||
* Concrete class for {@link ReactTextAnchorViewManager} which represents view managers of anchor
|
||||
@@ -109,18 +109,17 @@ public class ReactTextViewManager
|
||||
ReadableNativeMap localData,
|
||||
ReadableNativeMap props,
|
||||
float width,
|
||||
int widthMode,
|
||||
YogaMeasureMode widthMode,
|
||||
float height,
|
||||
int heightMode) {
|
||||
YogaMeasureMode heightMode) {
|
||||
|
||||
// TODO: should widthMode and heightMode be a YogaMeasureMode?
|
||||
return TextLayoutManager.measureText(context,
|
||||
view,
|
||||
localData,
|
||||
props,
|
||||
width,
|
||||
YogaMeasureMode.fromInt(widthMode),
|
||||
widthMode,
|
||||
height,
|
||||
YogaMeasureMode.fromInt(heightMode));
|
||||
heightMode);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user