react-native-advanced-text 0.2.11 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -19,6 +19,7 @@ import android.view.Menu
|
|
|
19
19
|
import android.view.MenuItem
|
|
20
20
|
import android.view.View
|
|
21
21
|
import android.view.MotionEvent
|
|
22
|
+
import android.view.accessibility.AccessibilityNodeInfo
|
|
22
23
|
import android.widget.TextView
|
|
23
24
|
import com.facebook.react.bridge.Arguments
|
|
24
25
|
import com.facebook.react.bridge.ReactContext
|
|
@@ -310,6 +311,15 @@ class AdvancedTextView : TextView {
|
|
|
310
311
|
Log.d(TAG, "Text updated with ${wordPositions.size} spans")
|
|
311
312
|
}
|
|
312
313
|
|
|
314
|
+
// Every word is a ClickableSpan so a tap can report it, but TalkBack treats
|
|
315
|
+
// each span as a link: it reads the text one word at a time and lists every
|
|
316
|
+
// word under Actions. Plain text keeps it reading as prose; granularity
|
|
317
|
+
// navigation still works since the characters are identical.
|
|
318
|
+
override fun onInitializeAccessibilityNodeInfo(info: AccessibilityNodeInfo) {
|
|
319
|
+
super.onInitializeAccessibilityNodeInfo(info)
|
|
320
|
+
info.text = text?.toString()
|
|
321
|
+
}
|
|
322
|
+
|
|
313
323
|
override fun onDraw(canvas: Canvas) {
|
|
314
324
|
drawHighlightedWordBackgrounds(canvas)
|
|
315
325
|
super.onDraw(canvas)
|
package/package.json
CHANGED