Migrate ReactText view to use uiManager.receiveEvent instead of ReactEventEmitter
Summary: This diff refactors ReactTextView to use uiManager.receiveEvent instead of ReactEventEmitter. ReactEventEmitter.class should be replaced for uiManager.receiveEvent. changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D21982548 fbshipit-source-id: 4ed5825f62c761564aa533f4e8bb1155036df7e2
This commit is contained in:
Родитель
95154a6b8b
Коммит
f53267f703
|
@ -37,7 +37,6 @@ import com.facebook.react.uimanager.UIManagerModule;
|
||||||
import com.facebook.react.uimanager.ViewDefaults;
|
import com.facebook.react.uimanager.ViewDefaults;
|
||||||
import com.facebook.react.uimanager.common.UIManagerType;
|
import com.facebook.react.uimanager.common.UIManagerType;
|
||||||
import com.facebook.react.uimanager.common.ViewUtil;
|
import com.facebook.react.uimanager.common.ViewUtil;
|
||||||
import com.facebook.react.uimanager.events.RCTEventEmitter;
|
|
||||||
import com.facebook.react.views.view.ReactViewBackgroundManager;
|
import com.facebook.react.views.view.ReactViewBackgroundManager;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -100,8 +99,9 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
|
||||||
protected void onLayout(
|
protected void onLayout(
|
||||||
boolean changed, int textViewLeft, int textViewTop, int textViewRight, int textViewBottom) {
|
boolean changed, int textViewLeft, int textViewTop, int textViewRight, int textViewBottom) {
|
||||||
// TODO T62882314: Delete this method when Fabric is fully released in OSS
|
// TODO T62882314: Delete this method when Fabric is fully released in OSS
|
||||||
|
int reactTag = getId();
|
||||||
if (!(getText() instanceof Spanned)
|
if (!(getText() instanceof Spanned)
|
||||||
|| ViewUtil.getUIManagerType(getId()) == UIManagerType.FABRIC) {
|
|| ViewUtil.getUIManagerType(reactTag) == UIManagerType.FABRIC) {
|
||||||
/**
|
/**
|
||||||
* In general, {@link #setText} is called via {@link ReactTextViewManager#updateExtraData}
|
* In general, {@link #setText} is called via {@link ReactTextViewManager#updateExtraData}
|
||||||
* before we are laid out. This ordering is a requirement because we utilize the data from
|
* before we are laid out. This ordering is a requirement because we utilize the data from
|
||||||
|
@ -257,9 +257,9 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
|
||||||
|
|
||||||
WritableMap event = Arguments.createMap();
|
WritableMap event = Arguments.createMap();
|
||||||
event.putArray("inlineViews", inlineViewInfoArray2);
|
event.putArray("inlineViews", inlineViewInfoArray2);
|
||||||
reactContext
|
if (uiManager != null) {
|
||||||
.getJSModule(RCTEventEmitter.class)
|
uiManager.receiveEvent(reactTag, "topInlineViewLayout", event);
|
||||||
.receiveEvent(getId(), "topInlineViewLayout", event);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче