Skip to content

Commit 71c82ce

Browse files
NickGerlemanfacebook-github-bot
authored andcommitted
Remove code related to onInlineViewLayout event
Summary: Afacit from searching both fbsource and GitHub, this should be totally dead. Changelog: [Internal] Reviewed By: alanleedev Differential Revision: D73154613 fbshipit-source-id: 1ed993ae53e7bc97232a8200b5fb4e01f0db7bb4
1 parent 96939f1 commit 71c82ce

File tree

5 files changed

+1
-60
lines changed

5 files changed

+1
-60
lines changed

Diff for: packages/react-native/Libraries/Text/TextNativeComponent.js

-4
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ const textViewConfig = {
4444
minimumFontScale: true,
4545
textBreakStrategy: true,
4646
onTextLayout: true,
47-
onInlineViewLayout: true,
4847
dataDetectorType: true,
4948
android_hyphenationFrequency: true,
5049
lineBreakStrategyIOS: true,
@@ -53,9 +52,6 @@ const textViewConfig = {
5352
topTextLayout: {
5453
registrationName: 'onTextLayout',
5554
},
56-
topInlineViewLayout: {
57-
registrationName: 'onInlineViewLayout',
58-
},
5955
},
6056
uiViewClassName: 'RCTText',
6157
};

Diff for: packages/react-native/ReactAndroid/api/ReactAndroid.api

-2
Original file line numberDiff line numberDiff line change
@@ -6392,7 +6392,6 @@ public abstract class com/facebook/react/views/text/ReactTextAnchorViewManager :
63926392
public fun setFontSize (Lcom/facebook/react/views/text/ReactTextView;F)V
63936393
public fun setIncludeFontPadding (Lcom/facebook/react/views/text/ReactTextView;Z)V
63946394
public fun setLetterSpacing (Lcom/facebook/react/views/text/ReactTextView;F)V
6395-
public fun setNotifyOnInlineViewLayout (Lcom/facebook/react/views/text/ReactTextView;Z)V
63966395
public fun setNumberOfLines (Lcom/facebook/react/views/text/ReactTextView;I)V
63976396
public fun setSelectable (Lcom/facebook/react/views/text/ReactTextView;Z)V
63986397
public fun setSelectionColor (Lcom/facebook/react/views/text/ReactTextView;Ljava/lang/Integer;)V
@@ -6465,7 +6464,6 @@ public class com/facebook/react/views/text/ReactTextView : androidx/appcompat/wi
64656464
public fun setLetterSpacing (F)V
64666465
public fun setLinkifyMask (I)V
64676466
public fun setMinimumFontSize (F)V
6468-
public fun setNotifyOnInlineViewLayout (Z)V
64696467
public fun setNumberOfLines (I)V
64706468
public fun setOverflow (Ljava/lang/String;)V
64716469
public fun setSpanned (Landroid/text/Spannable;)V

Diff for: packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java

-5
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,4 @@ public void setDataDetectorType(ReactTextView view, @Nullable String type) {
227227
// "none" case, default, and null type are equivalent.
228228
view.setLinkifyMask(0);
229229
}
230-
231-
@ReactProp(name = "onInlineViewLayout")
232-
public void setNotifyOnInlineViewLayout(ReactTextView view, boolean notifyOnInlineViewLayout) {
233-
view.setNotifyOnInlineViewLayout(notifyOnInlineViewLayout);
234-
}
235230
}

Diff for: packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java

-46
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import com.facebook.infer.annotation.Nullsafe;
3636
import com.facebook.react.bridge.Arguments;
3737
import com.facebook.react.bridge.ReactContext;
38-
import com.facebook.react.bridge.WritableArray;
3938
import com.facebook.react.bridge.WritableMap;
4039
import com.facebook.react.common.ReactConstants;
4140
import com.facebook.react.common.build.ReactBuildConfig;
@@ -57,9 +56,6 @@
5756
import com.facebook.react.views.text.internal.span.TextInlineImageSpan;
5857
import com.facebook.react.views.text.internal.span.TextInlineViewPlaceholderSpan;
5958
import com.facebook.yoga.YogaMeasureMode;
60-
import java.util.ArrayList;
61-
import java.util.Collections;
62-
import java.util.Comparator;
6359

6460
@Nullsafe(Nullsafe.Mode.LOCAL)
6561
public class ReactTextView extends AppCompatTextView implements ReactCompoundView {
@@ -78,7 +74,6 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
7874
private float mMinimumFontSize;
7975
private float mLetterSpacing;
8076
private int mLinkifyMaskType;
81-
private boolean mNotifyOnInlineViewLayout;
8277
private boolean mTextIsSelectable;
8378
private boolean mShouldAdjustSpannableFontSize;
8479
private Overflow mOverflow = Overflow.VISIBLE;
@@ -99,7 +94,6 @@ private void initView() {
9994
mNumberOfLines = ViewDefaults.NUMBER_OF_LINES;
10095
mAdjustsFontSizeToFit = false;
10196
mLinkifyMaskType = 0;
102-
mNotifyOnInlineViewLayout = false;
10397
mTextIsSelectable = false;
10498
mShouldAdjustSpannableFontSize = false;
10599
mEllipsizeLocation = TextUtils.TruncateAt.END;
@@ -235,8 +229,6 @@ protected void onLayout(
235229

236230
TextInlineViewPlaceholderSpan[] placeholders =
237231
text.getSpans(0, text.length(), TextInlineViewPlaceholderSpan.class);
238-
ArrayList inlineViewInfoArray =
239-
mNotifyOnInlineViewLayout ? new ArrayList(placeholders.length) : null;
240232
int textViewWidth = textViewRight - textViewLeft;
241233
int textViewHeight = textViewBottom - textViewTop;
242234

@@ -264,10 +256,6 @@ protected void onLayout(
264256
// loop when called on a character that appears after the ellipsis. Avoid this bug by
265257
// special casing the character truncation case.
266258
child.setVisibility(View.GONE);
267-
if (mNotifyOnInlineViewLayout) {
268-
Assertions.assertNotNull(inlineViewInfoArray)
269-
.add(inlineViewJson(View.GONE, start, -1, -1, -1, -1));
270-
}
271259
} else {
272260
int width = placeholder.getWidth();
273261
int height = placeholder.getHeight();
@@ -341,38 +329,8 @@ protected void onLayout(
341329
int layoutRight = left + width;
342330
int layoutBottom = top + height;
343331

344-
// Keep these parameters in sync with what goes into `inlineViewInfoArray`.
345332
child.setVisibility(layoutVisibility);
346333
child.layout(layoutLeft, layoutTop, layoutRight, layoutBottom);
347-
if (mNotifyOnInlineViewLayout) {
348-
Assertions.assertNotNull(inlineViewInfoArray)
349-
.add(
350-
inlineViewJson(
351-
layoutVisibility, start, layoutLeft, layoutTop, layoutRight, layoutBottom));
352-
}
353-
}
354-
}
355-
356-
if (mNotifyOnInlineViewLayout) {
357-
Collections.sort(
358-
inlineViewInfoArray,
359-
new Comparator() {
360-
@Override
361-
public int compare(Object o1, Object o2) {
362-
WritableMap m1 = (WritableMap) o1;
363-
WritableMap m2 = (WritableMap) o2;
364-
return m1.getInt("index") - m2.getInt("index");
365-
}
366-
});
367-
WritableArray inlineViewInfoArray2 = Arguments.createArray();
368-
for (Object item : Assertions.assertNotNull(inlineViewInfoArray)) {
369-
inlineViewInfoArray2.pushMap((WritableMap) item);
370-
}
371-
372-
WritableMap event = Arguments.createMap();
373-
event.putArray("inlineViews", inlineViewInfoArray2);
374-
if (uiManager != null) {
375-
uiManager.receiveEvent(reactTag, "topInlineViewLayout", event);
376334
}
377335
}
378336
}
@@ -696,10 +654,6 @@ public void setEllipsizeLocation(@Nullable TextUtils.TruncateAt ellipsizeLocatio
696654
mEllipsizeLocation = ellipsizeLocation;
697655
}
698656

699-
public void setNotifyOnInlineViewLayout(boolean notifyOnInlineViewLayout) {
700-
mNotifyOnInlineViewLayout = notifyOnInlineViewLayout;
701-
}
702-
703657
public void updateView() {
704658
@Nullable
705659
TextUtils.TruncateAt ellipsizeLocation =

Diff for: packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,7 @@ private Object getReactTextUpdate(ReactTextView view, ReactStylesDiffMap props,
201201
Map<String, Object> eventTypeConstants =
202202
baseEventTypeConstants == null ? new HashMap<String, Object>() : baseEventTypeConstants;
203203
eventTypeConstants.putAll(
204-
MapBuilder.of(
205-
"topTextLayout", MapBuilder.of("registrationName", "onTextLayout"),
206-
"topInlineViewLayout", MapBuilder.of("registrationName", "onInlineViewLayout")));
204+
MapBuilder.of("topTextLayout", MapBuilder.of("registrationName", "onTextLayout")));
207205
return eventTypeConstants;
208206
}
209207

0 commit comments

Comments
 (0)