Skip to content

Commit d845073

Browse files
committed
removing not relevant logic
1 parent 16f1f39 commit d845073

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import android.os.Message;
1616
import android.text.Layout;
1717
import android.text.Spannable;
18-
import android.text.SpannableString;
1918
import android.text.Spanned;
2019
import android.text.style.AbsoluteSizeSpan;
2120
import android.text.style.ClickableSpan;
@@ -46,7 +45,6 @@
4645
import com.facebook.react.uimanager.events.EventDispatcher;
4746
import com.facebook.react.uimanager.util.ReactFindViewUtil;
4847
import com.facebook.react.views.text.ReactSpan;
49-
import com.facebook.react.views.text.ReactTtsSpan;
5048
import java.util.ArrayList;
5149
import java.util.HashMap;
5250
import java.util.List;
@@ -666,16 +664,8 @@ public AccessibilityLinks(ReactSpan[] spans, Spannable text) {
666664

667665
final AccessibleLink link = new AccessibleLink();
668666
link.description = text.subSequence(start, end).toString();
669-
if (span instanceof ReactTtsSpan) {
670-
link.span = span;
671-
SpannableString spannableDescription = new SpannableString(text.subSequence(start, end));
672-
link.start = spannableDescription.getSpanStart(span);
673-
link.end = spannableDescription.getSpanEnd(span);
674-
}
675-
if (span instanceof ClickableSpan) {
676-
link.start = start;
677-
link.end = end;
678-
}
667+
link.start = start;
668+
link.end = end;
679669

680670
// ID is the reverse of what is expected, since the ClickableSpans are returned in reverse
681671
// order due to being added in reverse order. If we don't do this, focus will move to the
@@ -717,7 +707,6 @@ public int size() {
717707

718708
private static class AccessibleLink {
719709
public String description;
720-
public ReactSpan span;
721710
public int start;
722711
public int end;
723712
public int id;

ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,8 @@ private static void buildSpannedFromShadowNode(
183183
ops.add(
184184
new SetSpanOperation(start, end, new ReactClickableSpan(textShadowNode.getReactTag())));
185185
}
186-
if (textShadowNode.mIsAccessibilityUnit) {
187-
if (Build.VERSION.SDK_INT > 21) {
188-
ops.add(new SetSpanOperation(start, end, new ReactTtsSpan.Builder("verbatim").build()));
189-
}
186+
if (textShadowNode.mIsAccessibilityUnit && Build.VERSION.SDK_INT >= 21) {
187+
ops.add(new SetSpanOperation(start, end, new ReactTtsSpan.Builder("verbatim").build()));
190188
}
191189
float effectiveLetterSpacing = textAttributes.getEffectiveLetterSpacing();
192190
if (!Float.isNaN(effectiveLetterSpacing)

ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ public static WritableArray measureLines(
579579
// TODO T31905686: This class should be private
580580
public static class SetSpanOperation {
581581
protected int start, end;
582+
protected ReactSpan what;
582583

583584
public SetSpanOperation(int start, int end, ReactSpan what) {
584585
this.start = start;

0 commit comments

Comments
 (0)