react-native-a11y-order 0.9.1 → 0.11.0-rc

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.
Files changed (268) hide show
  1. package/README.md +50 -336
  2. package/android/src/main/java/com/a11yorder/A11yOrderPackage.java +2 -6
  3. package/android/src/main/java/com/a11yorder/core/A11yAutoFocusView.java +61 -0
  4. package/android/src/main/java/com/a11yorder/{views/A11yView/A11yView.java → core/A11yScreenReaderView.java} +3 -45
  5. package/android/src/main/java/com/a11yorder/core/A11yViewOrder.java +37 -0
  6. package/android/src/main/java/com/a11yorder/views/A11yCardView/A11yCardViewManager.java +18 -0
  7. package/android/src/main/java/com/a11yorder/views/A11yIndexView/A11yIndexView.java +2 -65
  8. package/android/src/main/java/com/a11yorder/views/A11yIndexView/A11yIndexViewManager.java +27 -0
  9. package/android/src/newarch/A11yCardViewManagerSpec.java +9 -0
  10. package/android/src/oldarch/A11yCardViewManagerSpec.java +8 -0
  11. package/android/src/oldarch/A11yIndexViewManagerSpec.java +9 -0
  12. package/ios/helpers/RNAOFabricEventHelper/RNAOFabricEventHelper.mm +5 -5
  13. package/ios/views/RNAOA11yCardView/RNAOA11yCardView.h +29 -0
  14. package/ios/views/RNAOA11yCardView/RNAOA11yCardView.mm +83 -0
  15. package/ios/views/RNAOA11yCardView/RNAOA11yCardViewManager.h +14 -0
  16. package/ios/views/RNAOA11yCardView/RNAOA11yCardViewManager.mm +17 -0
  17. package/ios/views/RNAOA11yIndexView/RNAOA11yIndexView.h +2 -41
  18. package/ios/views/RNAOA11yIndexView/RNAOA11yIndexView.mm +27 -127
  19. package/ios/views/RNAOA11yIndexView/RNAOA11yIndexViewManager.mm +21 -0
  20. package/ios/views/base/RNAOA11yAutoFocusView.h +30 -0
  21. package/ios/views/{RNAOA11yView/RNAOA11yView.mm → base/RNAOA11yAutoFocusView.mm} +66 -168
  22. package/ios/views/base/RNAOA11yGroupChildrenView.h +21 -0
  23. package/ios/views/base/RNAOA11yGroupChildrenView.mm +19 -0
  24. package/ios/views/base/RNAOA11yScreenReaderView.h +24 -0
  25. package/ios/views/base/RNAOA11yScreenReaderView.mm +32 -0
  26. package/ios/views/base/RNAOA11yViewGroup.h +35 -0
  27. package/ios/views/base/RNAOA11yViewGroup.mm +46 -0
  28. package/ios/views/base/RNAOA11yViewOrder.h +40 -0
  29. package/ios/views/base/RNAOA11yViewOrder.mm +92 -0
  30. package/lib/commonjs/components/A11yCard/A11yCard.ios.js +49 -0
  31. package/lib/commonjs/components/A11yCard/A11yCard.ios.js.map +1 -0
  32. package/lib/commonjs/components/A11yCard/A11yCard.js +41 -0
  33. package/lib/commonjs/components/A11yCard/A11yCard.js.map +1 -0
  34. package/lib/commonjs/{types/A11yGroup.types.js → components/A11yCard/A11yCard.types.js} +1 -1
  35. package/lib/commonjs/components/A11yCard/A11yCard.types.js.map +1 -0
  36. package/lib/commonjs/components/A11yIndex/A11yIndex.js +88 -28
  37. package/lib/commonjs/components/A11yIndex/A11yIndex.js.map +1 -1
  38. package/lib/commonjs/components/A11yIndex/A11yIndex.types.js +39 -0
  39. package/lib/commonjs/components/A11yIndex/A11yIndex.types.js.map +1 -0
  40. package/lib/commonjs/components/A11yIndex/A11yIndex.web.js.map +1 -1
  41. package/lib/commonjs/components/A11yLock/A11yFocusFrame/A11yFocusFrame.js.map +1 -1
  42. package/lib/commonjs/components/A11yLock/A11yFocusTrap/A11yFocusTrap.js.map +1 -1
  43. package/lib/commonjs/components/A11yLock/A11yLock.types.js.map +1 -0
  44. package/lib/commonjs/components/{A11ySequence/A11ySequence.js → A11yOrder/A11yOrder.js} +3 -3
  45. package/lib/commonjs/components/A11yOrder/A11yOrder.js.map +1 -0
  46. package/lib/commonjs/{types/A11yModule.types.js → components/A11yOrder/A11yOrder.types.js} +1 -1
  47. package/lib/commonjs/components/A11yOrder/A11yOrder.types.js.map +1 -0
  48. package/lib/commonjs/components/A11yPaneTitle/A11yPaneTitle.js +6 -7
  49. package/lib/commonjs/components/A11yPaneTitle/A11yPaneTitle.js.map +1 -1
  50. package/lib/commonjs/components/A11yPaneTitle/A11yPaneTitle.types.js +6 -0
  51. package/lib/commonjs/components/A11yPaneTitle/A11yPaneTitle.types.js.map +1 -0
  52. package/lib/commonjs/components/A11yView/A11yView.js +7 -33
  53. package/lib/commonjs/components/A11yView/A11yView.js.map +1 -1
  54. package/lib/commonjs/components/A11yView/A11yView.types.js.map +1 -0
  55. package/lib/commonjs/index.js +17 -8
  56. package/lib/commonjs/index.js.map +1 -1
  57. package/lib/commonjs/index.web.js +10 -4
  58. package/lib/commonjs/index.web.js.map +1 -1
  59. package/lib/commonjs/nativeSpecs/{A11yGroupNativeComponent.ts → A11yCardNativeComponent.ts} +3 -3
  60. package/lib/commonjs/nativeSpecs/A11yIndexNativeComponent.ts +12 -3
  61. package/lib/module/components/A11yCard/A11yCard.ios.js +43 -0
  62. package/lib/module/components/A11yCard/A11yCard.ios.js.map +1 -0
  63. package/lib/module/components/A11yCard/A11yCard.js +35 -0
  64. package/lib/module/components/A11yCard/A11yCard.js.map +1 -0
  65. package/lib/module/components/A11yCard/A11yCard.types.js +4 -0
  66. package/lib/module/components/A11yCard/A11yCard.types.js.map +1 -0
  67. package/lib/module/components/A11yIndex/A11yIndex.js +88 -28
  68. package/lib/module/components/A11yIndex/A11yIndex.js.map +1 -1
  69. package/lib/module/components/A11yIndex/A11yIndex.types.js +35 -0
  70. package/lib/module/components/A11yIndex/A11yIndex.types.js.map +1 -0
  71. package/lib/module/components/A11yIndex/A11yIndex.web.js.map +1 -1
  72. package/lib/module/components/A11yLock/A11yFocusFrame/A11yFocusFrame.js.map +1 -1
  73. package/lib/module/components/A11yLock/A11yFocusTrap/A11yFocusTrap.js.map +1 -1
  74. package/lib/module/components/A11yLock/A11yLock.types.js.map +1 -0
  75. package/lib/module/components/{A11ySequence/A11ySequence.js → A11yOrder/A11yOrder.js} +2 -2
  76. package/lib/module/components/A11yOrder/A11yOrder.js.map +1 -0
  77. package/lib/module/components/A11yOrder/A11yOrder.types.js +4 -0
  78. package/lib/module/components/A11yOrder/A11yOrder.types.js.map +1 -0
  79. package/lib/module/components/A11yPaneTitle/A11yPaneTitle.js +6 -7
  80. package/lib/module/components/A11yPaneTitle/A11yPaneTitle.js.map +1 -1
  81. package/lib/module/components/A11yPaneTitle/A11yPaneTitle.types.js +4 -0
  82. package/lib/module/components/A11yPaneTitle/A11yPaneTitle.types.js.map +1 -0
  83. package/lib/module/components/A11yView/A11yView.js +7 -31
  84. package/lib/module/components/A11yView/A11yView.js.map +1 -1
  85. package/lib/module/components/A11yView/A11yView.types.js.map +1 -0
  86. package/lib/module/index.js +12 -8
  87. package/lib/module/index.js.map +1 -1
  88. package/lib/module/index.web.js +4 -4
  89. package/lib/module/index.web.js.map +1 -1
  90. package/{src/nativeSpecs/A11yGroupNativeComponent.ts → lib/module/nativeSpecs/A11yCardNativeComponent.ts} +3 -3
  91. package/lib/module/nativeSpecs/A11yIndexNativeComponent.ts +12 -3
  92. package/lib/typescript/src/components/A11yCard/A11yCard.d.ts +5 -0
  93. package/lib/typescript/src/components/A11yCard/A11yCard.d.ts.map +1 -0
  94. package/lib/typescript/src/components/A11yCard/A11yCard.ios.d.ts +5 -0
  95. package/lib/typescript/src/components/A11yCard/A11yCard.ios.d.ts.map +1 -0
  96. package/lib/typescript/src/components/A11yCard/A11yCard.types.d.ts +38 -0
  97. package/lib/typescript/src/components/A11yCard/A11yCard.types.d.ts.map +1 -0
  98. package/lib/typescript/src/components/A11yIndex/A11yIndex.d.ts +15 -10
  99. package/lib/typescript/src/components/A11yIndex/A11yIndex.d.ts.map +1 -1
  100. package/lib/typescript/src/components/A11yIndex/A11yIndex.types.d.ts +105 -0
  101. package/lib/typescript/src/components/A11yIndex/A11yIndex.types.d.ts.map +1 -0
  102. package/lib/typescript/src/components/A11yIndex/A11yIndex.web.d.ts +14 -10
  103. package/lib/typescript/src/components/A11yIndex/A11yIndex.web.d.ts.map +1 -1
  104. package/lib/typescript/src/components/A11yLock/A11yBaseLock/A11yBaseLock.d.ts +1 -1
  105. package/lib/typescript/src/components/A11yLock/A11yBaseLock/A11yBaseLock.d.ts.map +1 -1
  106. package/lib/typescript/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.android.d.ts +1 -1
  107. package/lib/typescript/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.android.d.ts.map +1 -1
  108. package/lib/typescript/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.d.ts +2 -2
  109. package/lib/typescript/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.d.ts.map +1 -1
  110. package/lib/typescript/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.android.d.ts +1 -1
  111. package/lib/typescript/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.android.d.ts.map +1 -1
  112. package/lib/typescript/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.d.ts +2 -2
  113. package/lib/typescript/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.d.ts.map +1 -1
  114. package/lib/typescript/src/components/A11yLock/A11yLock.types.d.ts +35 -0
  115. package/lib/typescript/src/components/A11yLock/A11yLock.types.d.ts.map +1 -0
  116. package/lib/typescript/src/components/{A11ySequence/A11ySequence.d.ts → A11yOrder/A11yOrder.d.ts} +4 -2
  117. package/lib/typescript/src/components/A11yOrder/A11yOrder.d.ts.map +1 -0
  118. package/lib/typescript/src/components/A11yOrder/A11yOrder.types.d.ts +11 -0
  119. package/lib/typescript/src/components/A11yOrder/A11yOrder.types.d.ts.map +1 -0
  120. package/lib/typescript/src/components/A11yPaneTitle/A11yPaneTitle.d.ts +3 -17
  121. package/lib/typescript/src/components/A11yPaneTitle/A11yPaneTitle.d.ts.map +1 -1
  122. package/lib/typescript/src/components/A11yPaneTitle/A11yPaneTitle.types.d.ts +52 -0
  123. package/lib/typescript/src/components/A11yPaneTitle/A11yPaneTitle.types.d.ts.map +1 -0
  124. package/lib/typescript/src/components/A11yView/A11yView.d.ts +13 -6
  125. package/lib/typescript/src/components/A11yView/A11yView.d.ts.map +1 -1
  126. package/lib/typescript/src/components/A11yView/A11yView.types.d.ts +10 -0
  127. package/lib/typescript/src/components/A11yView/A11yView.types.d.ts.map +1 -0
  128. package/lib/typescript/src/index.d.ts +32 -36
  129. package/lib/typescript/src/index.d.ts.map +1 -1
  130. package/lib/typescript/src/index.web.d.ts +22 -22
  131. package/lib/typescript/src/index.web.d.ts.map +1 -1
  132. package/lib/typescript/src/nativeSpecs/A11yCardNativeComponent.d.ts +8 -0
  133. package/lib/typescript/src/nativeSpecs/A11yCardNativeComponent.d.ts.map +1 -0
  134. package/lib/typescript/src/nativeSpecs/A11yIndexNativeComponent.d.ts +10 -3
  135. package/lib/typescript/src/nativeSpecs/A11yIndexNativeComponent.d.ts.map +1 -1
  136. package/package.json +12 -11
  137. package/src/components/A11yCard/A11yCard.ios.tsx +44 -0
  138. package/src/components/A11yCard/A11yCard.tsx +35 -0
  139. package/src/components/A11yCard/A11yCard.types.ts +50 -0
  140. package/src/components/A11yIndex/A11yIndex.tsx +144 -52
  141. package/src/components/A11yIndex/A11yIndex.types.ts +124 -0
  142. package/src/components/A11yIndex/A11yIndex.web.tsx +12 -17
  143. package/src/components/A11yLock/A11yBaseLock/A11yBaseLock.tsx +1 -1
  144. package/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.android.tsx +1 -1
  145. package/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.tsx +3 -2
  146. package/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.android.tsx +1 -1
  147. package/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.tsx +2 -2
  148. package/src/components/A11yLock/A11yLock.types.ts +38 -0
  149. package/src/components/{A11ySequence/A11ySequence.tsx → A11yOrder/A11yOrder.tsx} +4 -2
  150. package/src/components/A11yOrder/A11yOrder.types.ts +11 -0
  151. package/src/components/A11yPaneTitle/A11yPaneTitle.tsx +13 -19
  152. package/src/components/A11yPaneTitle/A11yPaneTitle.types.ts +58 -0
  153. package/src/components/A11yView/A11yView.tsx +8 -63
  154. package/src/components/A11yView/A11yView.types.ts +11 -0
  155. package/src/index.ts +26 -19
  156. package/src/index.web.ts +6 -13
  157. package/{lib/module/nativeSpecs/A11yGroupNativeComponent.ts → src/nativeSpecs/A11yCardNativeComponent.ts} +3 -3
  158. package/src/nativeSpecs/A11yIndexNativeComponent.ts +12 -3
  159. package/android/src/main/java/com/a11yorder/views/A11yGroupView/A11yGroupViewManager.java +0 -25
  160. package/android/src/main/java/com/a11yorder/views/A11yUIContainerView/A11yUIContainerViewManager.java +0 -30
  161. package/android/src/main/java/com/a11yorder/views/A11yView/A11yViewManager.java +0 -67
  162. package/android/src/newarch/A11yGroupViewManagerSpec.java +0 -9
  163. package/android/src/newarch/A11yUIContainerViewManagerSpec.java +0 -8
  164. package/android/src/newarch/A11yViewSpec.java +0 -13
  165. package/android/src/oldarch/A11yGroupViewManagerSpec.java +0 -8
  166. package/android/src/oldarch/A11yUIContainerViewManagerSpec.java +0 -9
  167. package/android/src/oldarch/A11yViewSpec.java +0 -18
  168. package/ios/views/RNAOA11yGroupView/RNAOA11yGroupView.h +0 -37
  169. package/ios/views/RNAOA11yGroupView/RNAOA11yGroupView.mm +0 -67
  170. package/ios/views/RNAOA11yGroupView/RNAOA11yGroupViewManager.h +0 -18
  171. package/ios/views/RNAOA11yGroupView/RNAOA11yGroupViewManager.mm +0 -25
  172. package/ios/views/RNAOA11yUIContainerView/RNAOA11yUIContainerView.h +0 -35
  173. package/ios/views/RNAOA11yUIContainerView/RNAOA11yUIContainerView.mm +0 -79
  174. package/ios/views/RNAOA11yUIContainerView/RNAOA11yUIContainerViewManager.h +0 -18
  175. package/ios/views/RNAOA11yUIContainerView/RNAOA11yUIContainerViewManager.mm +0 -27
  176. package/ios/views/RNAOA11yView/RNAOA11yView.h +0 -45
  177. package/ios/views/RNAOA11yView/RNAOA11yViewManager.h +0 -14
  178. package/ios/views/RNAOA11yView/RNAOA11yViewManager.mm +0 -53
  179. package/lib/commonjs/components/A11yGroup/A11yGroup.android.js +0 -18
  180. package/lib/commonjs/components/A11yGroup/A11yGroup.android.js.map +0 -1
  181. package/lib/commonjs/components/A11yGroup/A11yGroup.ios.js +0 -24
  182. package/lib/commonjs/components/A11yGroup/A11yGroup.ios.js.map +0 -1
  183. package/lib/commonjs/components/A11yGroup/A11yGroup.js +0 -9
  184. package/lib/commonjs/components/A11yGroup/A11yGroup.js.map +0 -1
  185. package/lib/commonjs/components/A11ySequence/A11ySequence.js.map +0 -1
  186. package/lib/commonjs/components/A11yUIContainer/A11yUIContainer.ios.js +0 -22
  187. package/lib/commonjs/components/A11yUIContainer/A11yUIContainer.ios.js.map +0 -1
  188. package/lib/commonjs/components/A11yUIContainer/A11yUIContainer.js +0 -9
  189. package/lib/commonjs/components/A11yUIContainer/A11yUIContainer.js.map +0 -1
  190. package/lib/commonjs/nativeSpecs/A11yUIContainerNativeComponent.ts +0 -12
  191. package/lib/commonjs/nativeSpecs/A11yViewNativeComponent.ts +0 -36
  192. package/lib/commonjs/types/A11yGroup.types.js.map +0 -1
  193. package/lib/commonjs/types/A11yIndex.types.js +0 -13
  194. package/lib/commonjs/types/A11yIndex.types.js.map +0 -1
  195. package/lib/commonjs/types/A11yLock.types.js.map +0 -1
  196. package/lib/commonjs/types/A11yModule.types.js.map +0 -1
  197. package/lib/commonjs/types/A11yUIContainerView.types.js +0 -15
  198. package/lib/commonjs/types/A11yUIContainerView.types.js.map +0 -1
  199. package/lib/commonjs/types/A11yView.types.js.map +0 -1
  200. package/lib/module/components/A11yGroup/A11yGroup.android.js +0 -12
  201. package/lib/module/components/A11yGroup/A11yGroup.android.js.map +0 -1
  202. package/lib/module/components/A11yGroup/A11yGroup.ios.js +0 -18
  203. package/lib/module/components/A11yGroup/A11yGroup.ios.js.map +0 -1
  204. package/lib/module/components/A11yGroup/A11yGroup.js +0 -5
  205. package/lib/module/components/A11yGroup/A11yGroup.js.map +0 -1
  206. package/lib/module/components/A11ySequence/A11ySequence.js.map +0 -1
  207. package/lib/module/components/A11yUIContainer/A11yUIContainer.ios.js +0 -17
  208. package/lib/module/components/A11yUIContainer/A11yUIContainer.ios.js.map +0 -1
  209. package/lib/module/components/A11yUIContainer/A11yUIContainer.js +0 -5
  210. package/lib/module/components/A11yUIContainer/A11yUIContainer.js.map +0 -1
  211. package/lib/module/nativeSpecs/A11yUIContainerNativeComponent.ts +0 -12
  212. package/lib/module/nativeSpecs/A11yViewNativeComponent.ts +0 -36
  213. package/lib/module/types/A11yGroup.types.js +0 -4
  214. package/lib/module/types/A11yGroup.types.js.map +0 -1
  215. package/lib/module/types/A11yIndex.types.js +0 -9
  216. package/lib/module/types/A11yIndex.types.js.map +0 -1
  217. package/lib/module/types/A11yLock.types.js.map +0 -1
  218. package/lib/module/types/A11yModule.types.js +0 -4
  219. package/lib/module/types/A11yModule.types.js.map +0 -1
  220. package/lib/module/types/A11yUIContainerView.types.js +0 -11
  221. package/lib/module/types/A11yUIContainerView.types.js.map +0 -1
  222. package/lib/module/types/A11yView.types.js.map +0 -1
  223. package/lib/typescript/src/components/A11yGroup/A11yGroup.android.d.ts +0 -4
  224. package/lib/typescript/src/components/A11yGroup/A11yGroup.android.d.ts.map +0 -1
  225. package/lib/typescript/src/components/A11yGroup/A11yGroup.d.ts +0 -3
  226. package/lib/typescript/src/components/A11yGroup/A11yGroup.d.ts.map +0 -1
  227. package/lib/typescript/src/components/A11yGroup/A11yGroup.ios.d.ts +0 -4
  228. package/lib/typescript/src/components/A11yGroup/A11yGroup.ios.d.ts.map +0 -1
  229. package/lib/typescript/src/components/A11ySequence/A11ySequence.d.ts.map +0 -1
  230. package/lib/typescript/src/components/A11yUIContainer/A11yUIContainer.d.ts +0 -3
  231. package/lib/typescript/src/components/A11yUIContainer/A11yUIContainer.d.ts.map +0 -1
  232. package/lib/typescript/src/components/A11yUIContainer/A11yUIContainer.ios.d.ts +0 -4
  233. package/lib/typescript/src/components/A11yUIContainer/A11yUIContainer.ios.d.ts.map +0 -1
  234. package/lib/typescript/src/nativeSpecs/A11yGroupNativeComponent.d.ts +0 -8
  235. package/lib/typescript/src/nativeSpecs/A11yGroupNativeComponent.d.ts.map +0 -1
  236. package/lib/typescript/src/nativeSpecs/A11yUIContainerNativeComponent.d.ts +0 -10
  237. package/lib/typescript/src/nativeSpecs/A11yUIContainerNativeComponent.d.ts.map +0 -1
  238. package/lib/typescript/src/nativeSpecs/A11yViewNativeComponent.d.ts +0 -26
  239. package/lib/typescript/src/nativeSpecs/A11yViewNativeComponent.d.ts.map +0 -1
  240. package/lib/typescript/src/types/A11yGroup.types.d.ts +0 -7
  241. package/lib/typescript/src/types/A11yGroup.types.d.ts.map +0 -1
  242. package/lib/typescript/src/types/A11yIndex.types.d.ts +0 -19
  243. package/lib/typescript/src/types/A11yIndex.types.d.ts.map +0 -1
  244. package/lib/typescript/src/types/A11yLock.types.d.ts +0 -8
  245. package/lib/typescript/src/types/A11yLock.types.d.ts.map +0 -1
  246. package/lib/typescript/src/types/A11yModule.types.d.ts +0 -7
  247. package/lib/typescript/src/types/A11yModule.types.d.ts.map +0 -1
  248. package/lib/typescript/src/types/A11yUIContainerView.types.d.ts +0 -13
  249. package/lib/typescript/src/types/A11yUIContainerView.types.d.ts.map +0 -1
  250. package/lib/typescript/src/types/A11yView.types.d.ts +0 -12
  251. package/lib/typescript/src/types/A11yView.types.d.ts.map +0 -1
  252. package/src/components/A11yGroup/A11yGroup.android.tsx +0 -8
  253. package/src/components/A11yGroup/A11yGroup.ios.tsx +0 -11
  254. package/src/components/A11yGroup/A11yGroup.tsx +0 -5
  255. package/src/components/A11yUIContainer/A11yUIContainer.ios.tsx +0 -20
  256. package/src/components/A11yUIContainer/A11yUIContainer.tsx +0 -5
  257. package/src/nativeSpecs/A11yUIContainerNativeComponent.ts +0 -12
  258. package/src/nativeSpecs/A11yViewNativeComponent.ts +0 -36
  259. package/src/types/A11yGroup.types.ts +0 -9
  260. package/src/types/A11yIndex.types.ts +0 -21
  261. package/src/types/A11yLock.types.ts +0 -8
  262. package/src/types/A11yModule.types.ts +0 -7
  263. package/src/types/A11yUIContainerView.types.ts +0 -15
  264. package/src/types/A11yView.types.ts +0 -19
  265. /package/lib/commonjs/{types → components/A11yLock}/A11yLock.types.js +0 -0
  266. /package/lib/commonjs/{types → components/A11yView}/A11yView.types.js +0 -0
  267. /package/lib/module/{types → components/A11yLock}/A11yLock.types.js +0 -0
  268. /package/lib/module/{types → components/A11yView}/A11yView.types.js +0 -0
package/README.md CHANGED
@@ -1,371 +1,85 @@
1
- # React Native A11y Order
2
-
3
- React Native A11y Order Library: Enhance screen reader functionality with advanced control.
1
+ ![react-native-a11y-order](/.github/images/react_native_a11y_order.png)
4
2
 
5
- Managing screen reader focus order can be challenging, especially in complex or unconventional scenarios. The `react-native-a11y-order` library is built with a native-first approach to resolve issues related to screen reader focus order and provide additional accessibility features on both Android and iOS platforms.
3
+ # React Native A11y Order
6
4
 
7
- | iOS reader | Android reader |
8
- | --------------------------------------------------------- | ------------------------------------------------------------- |
9
- | <img src="/.github/images/ios_example.gif" height="500" /> | <img src="/.github/images/android_example.gif" height="500" /> |
5
+ <div>
6
+ <img align="right" width="35%" src="/.github/images/ios_example.gif">
7
+ </div>
10
8
 
9
+ Native-first React Native library for controlling screen reader focus order on iOS (VoiceOver) and Android (TalkBack).
11
10
 
12
- - Bridgeless
13
- - New architecture
14
- - Old architecture
15
- - Backward compatibility
16
- - Compatible with Expo prebuild
11
+ - 🔢 **Custom focus order** — define the exact sequence, independent of render order
12
+ - 🃏 **Cards with inner buttons** — card action and nested controls, both accessible at once
13
+ - 🔒 **Focus trap** — keep VoiceOver and TalkBack inside modals, no leaking
14
+ - 📣 **Transition announcements** — notify the screen reader on screen and panel changes
15
+ - New Architecture · Old Architecture · Bridgeless · Expo prebuild
17
16
 
18
17
  > [!TIP]
19
- > If you need to adjust the horizontal or vertical focus order, consider using `<View collapsable={false}>` as a quick fix.
20
- > By default, React Native optimizes views, which can sometimes impact the focus order unintentionally.
21
- >
22
- > While this library is designed to handle complex or unusual focus scenarios, in many cases, using `<View collapsable={false}>` can resolve focus issues without requiring additional work.
18
+ > Before adding this library, try `<View collapsable={false}>` it fixes most simple focus order issues with no extra dependencies. [Learn more](./docs/guides/collapsable.md)
23
19
 
24
20
  > [!IMPORTANT]
25
- > Starting from React Native v0.8.2, an experimental feature `experimental_accessibilityOrder` is available for setting the correct focus order.
26
- > You can find more information in the [Accessibility documentation](https://reactnative.dev/docs/accessibility).
21
+ > React Native v0.8.2+ includes an experimental `experimental_accessibilityOrder` prop see [Accessibility docs](https://reactnative.dev/docs/accessibility).
27
22
 
23
+ </br>
28
24
 
29
25
  ## Installation
30
26
 
31
- ```sh
32
- npm install react-native-a11y-order
33
- ```
34
-
35
27
  ```sh
36
28
  yarn add react-native-a11y-order
29
+ cd ios && pod install
37
30
  ```
38
31
 
39
- ## Usage
40
-
41
- #### A11y.Order, A11y.Index
42
-
43
- To set the focus order for a screen reader in React Native, you can use the following components:
44
- - `A11y.Order`: A container component that creates an ordering group for focusable elements.
45
- - `A11y.Index`: A wrapper component that defines the position of an element within the ordering group.
46
-
47
- Using these components together simplifies the process of managing focus order in complex UI structures.
48
-
49
- To illustrate, let's look at an example:
50
-
51
- ```js
52
- import { A11y } from 'react-native-a11y-order';
53
-
54
- // ...
55
-
56
- export default function App() {
57
- return (
58
- <View style={styles.container}>
59
- <A11y.Order>
60
- <A11y.Index index={1}>
61
- <Text style={styles.font}>
62
- First
63
- </Text>
64
- </A11y.Index>
65
- <A11y.Index index={3}>
66
- <Text style={styles.font}>
67
- Third
68
- </Text>
69
- </A11y.Index>
70
- <A11y.Index index={2}>
71
- <Text style={styles.font}>
72
- Second
73
- </Text>
74
- </A11y.Index>
75
- </A11y.Order>
76
- <Text style={styles.font}>Fourth</Text>
77
- <Text style={styles.font}>Fifth</Text>
78
- <Text style={styles.font}>Sixth</Text>
79
- </View>
80
- );
81
- }
82
- ```
83
-
84
- Additionally, for dynamic interaction scenarios, programmatically setting focus can be highly effective. You can achieve this by using the focus method through a component reference.
85
-
86
- ```js
87
- import { A11y, IndexCommands } from 'react-native-a11y-order';
88
-
89
- // ...
90
-
91
- export default function App() {
92
- const ref = React.useRef<IndexCommands>(null);
93
-
94
- return (
95
- <View style={styles.container}>
96
- <A11y.Order>
97
- <A11y.Index ref={ref} index={1}>
98
- <Text style={styles.font}>
99
- First
100
- </Text>
101
- </A11y.Index>
102
- </A11y.Order>
103
- <Button onPress={() => ref.current?.focus()}>
104
- </View>
105
- );
106
- }
107
- ```
108
- A11y.Index Props:
109
- | Prop | Description |
110
- | :-- | :-- |
111
- | ViewProps | Standard React Native View properties, including style, testID, etc. |
112
- | index | (number) The position of the component in the order sequence. |
113
- | ref: focus | Reference to a focus command, used to set accessibility focus programmatically. |
114
- | orderType | Specifies the algorithm used for view ordering (see details below). |
115
- | onScreenReaderSubViewFocused | Triggered when a subview within the component is focused by the screen reader. |
116
- | onScreenReaderSubViewBlurred | Triggered when the screen reader focus moves away or is blurred from a subview. |
117
- | onScreenReaderSubViewFocusChange | Triggered when the focus status of a subview changes (either focused or blurred). |
118
-
119
-
120
- | Value | Description |
121
- | :-- | :-- |
122
- | default | Treats the root component as an orderable element. This can be a group or a single element. If multiple elements are present, navigation moves through the inner elements before proceeding to the next index. |
123
- | legacy | Uses the previous implementation for element search, selecting the first child as the accessibility element for ordering. |
124
- | search | Searches the child tree for the first accessible element to use in the order. |
125
-
126
-
127
- A11y.Order Props:
128
-
129
- | Prop | Description |
130
- | :-- | :-- |
131
- | ...ViewProps | Standard React Native View props, including style, testID, etc. |
132
-
133
- ## A11y.Container
134
- | View | A11y.Container |
135
- | --------------------------------------------------------- | ------------------------------------------------------------- |
136
- | <img src="/.github/images/horizontal-scroll-view.gif" height="500" /> | <img src="/.github/images/horizontal-scroll-group.gif" height="500" /> |
137
-
138
- The `A11y.Container` component for configuration `UIAccessibilityContainerType` feature on iOS.
139
- | Props | Description |
140
- | :-- | :-- |
141
- | ViewProps | Default view props, including style, testID, etc. |
142
- | type?: | `none` \| `table` \| `list` \| `landmark` \| `group` — representation of `UIAccessibilityContainerType`. The default value is `group`. |
143
-
144
-
145
- ## A11y.View
146
- `The A11y.View` component can be used to handle and track screen reader focus independently of the `A11y.Index` component.
147
-
148
- | Prop | Description |
149
- | :-- | :-- |
150
- | onScreenReaderFocused | Triggered when the view gets focus from the screen reader. |
151
- | onScreenReaderSubViewFocused | Triggered when a subview within the component is focused by the screen reader. |
152
- | onScreenReaderSubViewBlurred | Triggered when the screen reader focus moves away or is blurred from a subview. |
153
- | onScreenReaderSubViewFocusChange | Triggered when the focus status of a subview changes (either focused or blurred). |
154
- | onScreenReaderDescendantFocusChanged | Triggered when any descendant subview is focused by the screen reader. Provides an object containing the focus status and the nativeId of the focused subview, if applicable. Example: < { status: string, nativeId?: string } >. |
155
-
156
- ```tsx
157
- <A11y.View
158
- onScreenReaderDescendantFocusChanged={(e) => console.log(e)}
159
- onScreenReaderSubViewFocused={() => console.log('List has been focused')}
160
- onScreenReaderSubViewBlurred={() => console.log('List has been blurred')}
161
- onScreenReaderFocused={() => console.log('Focused')}
162
- >
163
- ...
164
- </A11y.View>
165
- ```
166
-
167
- ## A11y.FocusFrame, A11y.FocusTrap
168
-
169
- These components enhance accessibility by providing better control over focus management within specific areas of the screen.
170
-
171
- - `A11y.FocusFrame`: Used at the root level of a "screen" to detect and prevent focus leaks, ensuring focus remains contained.
172
- - `A11y.FocusTrap`: Wraps the content area to explicitly enforce focus confinement within a defined region.
173
-
174
- On iOS, `A11y.FocusTrap` uses `accessibilityViewIsModal` to keep focus within the defined area. When `forceLock` is enabled, it additionally uses active enforcement — redirecting VoiceOver back into the trap whenever focus escapes and blocking focus from leaving at the system level.
175
-
176
- On Android, `A11y.FocusTrap` uses a custom Activity or Modal to limit focus.
177
-
178
- `A11y.FocusTrap` Props:
179
-
180
- | Prop | Description |
181
- | :-- | :-- |
182
- | ViewProps | Includes all standard React Native View properties, such as style, testID, etc. |
183
- | lockDisabled? | Disables the focus lock when `true`. |
184
- | forceLock? | (iOS only) Enables active focus enforcement — VoiceOver is redirected back into the trap whenever focus escapes. Use when `accessibilityViewIsModal` alone is not sufficient. |
185
-
186
- ```tsx
187
- <A11y.FocusFrame>
188
- ...
189
- <A11y.FocusTrap>
190
- <Text accessibilityRole="header">Locked Area</Text>
191
- <Button
192
- title="Confirm"
193
- accessibilityLabel="Confirm action"
194
- />
195
- </A11y.FocusTrap>
196
- ...
197
- </A11y.FocusFrame>
198
- ```
199
-
200
- Use `forceLock` when the standard lock is not enough to keep VoiceOver inside the trap:
201
-
202
- ```tsx
203
- <A11y.FocusFrame>
204
- ...
205
- <A11y.FocusTrap forceLock>
206
- <Text accessibilityRole="header">Locked Area</Text>
207
- <Button
208
- title="Confirm"
209
- accessibilityLabel="Confirm action"
210
- />
211
- </A11y.FocusTrap>
212
- ...
213
- </A11y.FocusFrame>
214
- ```
215
-
216
- ## A11y.PaneTitle, A11y.ScreenChange
217
-
218
- Components for screen change announcements
219
-
32
+ Get started with the [getting started guide](./docs/getting-started/getting-started.md) or jump straight to the [component overview](./docs/guides/overview.md).
220
33
 
221
- React Native currently lacks built-in APIs for announcing modal or screen transitions. To enhance accessibility, you can use A11y.PaneTitle or A11y.ScreenChange:
222
- - Screen transitions: Announce navigation to a new screen (e.g., "Login Screen").
223
- - Modal presentations: Announce when a modal appears (e.g., "Confirm Modal").
34
+ ## React Native compatibility
224
35
 
225
- | Prop | Description |
36
+ | Library version | React Native |
226
37
  | :-- | :-- |
227
- | title | The title message to be announced for the screen or modal. |
228
- | detachMessage | The message to be announced when this component is detached (e.g., when leaving the screen). |
229
- | type | The type of announcement for Android. Options: activity, pane, or announce. |
230
- | displayed | A trigger for screen focus changes, used to properly update the Android Activity title when switching screens. |
231
- | withFocusRestore | Ensures that the screen reader focus is preserved and restored appropriately after a screen change. (iOS-specific) |
38
+ | `1.0.0` | 0.80 |
39
+ | `0.11.0` | 0.79 |
232
40
 
233
- The `A11y.ScreenChange` component is a simplified version of `A11y.PaneTitle`. It is preconfigured with `type="activity"` to handle screen change announcements on Android. Beyond that, it behaves identically to `A11y.PaneTitle`.
41
+ ## What's available
234
42
 
235
- Example:
236
- ```tsx
237
- export const LoginScreen = ({ navigation }) => {
238
- const isFocused = useIsFocused();
239
- return (
240
- <View>
241
- <A11y.ScreenChange
242
- title="Login Screen"
243
- displayed={isFocused}
244
- />
245
- <View style={styles.container}>
246
- <Text>Welcome to the Login Screen</Text>
247
- <Button title="Continue" onPress={() => navigation.navigate('Home')} />
248
- </View>
249
- </View>
250
- );
251
- };
252
- ```
253
-
254
- ## A11yModule
255
- `A11yModule` provides an alternative solution for reliably announcing information on iOS.
256
-
257
- The default `AccessibilityInfo.announceForAccessibility` function on iOS can often be disrupted by focus changes. For instance, announcements might get interrupted by actions such as navigating between screens or opening a modal.
258
-
259
- To overcome this limitation, `A11yModule.announce` is implemented with a custom solution that leverages native events, ensuring that announcements are delivered reliably and are less likely to be interrupted.
260
-
261
- | Function | Description |
43
+ | Export | Purpose |
262
44
  | :-- | :-- |
263
- | announce(message: string): void | Posts a message to be announced by the screen reader with improved reliability on iOS. |
264
-
265
- ```tsx
266
- A11yModule.announce('This is a custom announcement, now more reliable on iOS!');
267
- ```
268
-
269
- ## Migration
270
-
271
- <details>
272
- <summary>Why?</summary>
273
-
274
- The previous versions of this library used native modules to update order, but in a world with Fabric components and new architecture, there is no visible future for managing native components via modules or `findNodeHandler`.
45
+ | [`A11y.Order`](./docs/guides/a11y-order.md) | Container that defines a named focus-order sequence. |
46
+ | [`A11y.Index`](./docs/components/A11yIndex.md) | Positioned slot within an `A11y.Order` sequence. |
47
+ | [`A11y.View`](./docs/components/A11yView.md) | Standalone view with screen reader focus events; no ordering. |
48
+ | [`A11y.Card`](./docs/components/A11yCard.md) | Card that keeps both a card-level action and nested buttons accessible simultaneously. |
49
+ | [`A11y.FocusTrap`](./docs/components/A11yFocusTrap.md) | Confines screen reader focus to a subtree (modal/overlay). |
50
+ | [`A11y.FocusFrame`](./docs/components/A11yFocusTrap.md) | Root boundary required by `A11y.FocusTrap`; detects focus escaping the region. |
51
+ | [`A11y.PaneTitle`](./docs/components/A11yPaneTitle.md) | Announces screen or panel transitions to VoiceOver/TalkBack. |
52
+ | [`A11y.ScreenChange`](./docs/components/A11yPaneTitle.md) | Shorthand for `A11y.PaneTitle` with `type="activity"` pre-set. |
53
+ | [`A11yModule`](./docs/leftovers/announce.md) | Reliable programmatic announcements on iOS. |
275
54
 
276
- I thought a lot about retaining the previous API for support and compatibility, but after investigation, it was decided to deprecate the 'old' API and remove it in future releases.
277
-
278
- The new approach is better: we no longer need to manage refs, worry about attaching nodes to the screen, and it works natively. Additionally, this new approach follows the React Native concept, which will make it easier to support in the future (hello there: bridgeless).
279
-
280
- </details>
281
-
282
- 1. Update: `A11yOrder` to `A11y.Order`
283
-
284
- ```js
285
- Previous: <A11yOrder a11yOrder={a11yOrder}>
286
- Now: <A11y.Order>
287
- ```
288
-
289
- 2. Wrap components in `A11y.Index`
290
-
291
- ```js
292
- Previous: <Text style={styles.font} ref={refs[0]}>
293
- First
294
- </Text>
295
- Now: <A11y.Index index={1}>
296
- <Text style={styles.font} ref={refs[0]}>
297
- First
298
- </Text>
299
- </A11y.Index>
300
- ```
301
-
302
- 3. Remove unnecessary refs
303
-
304
- ```js
305
- <A11y.Index index={1}>
306
- <Text style={styles.font}>
307
- First
308
- </Text>
309
- </A11y.Index>
310
- ```
311
-
312
- 4. Remove deprecated hooks and utilities: `useFocusOrder`, `useDynamicFocusOrder`, `useA11yOrderManager`.
313
-
314
- That's all. The index changes, removals, etc., should work out of the box.
315
-
316
- ## Legacy
317
- #### A11y.Group
55
+ ---
318
56
 
319
- `A11y.Group` (`A11y.Container`) can be used to enhance the experience of screen readers navigating through `ScrollView` or `FlatList` with the horizontal property enabled. You can skip this if you are using the new architecture; however, it is the best for applications that have not yet migrated.
57
+ ## Documentation
320
58
 
321
- | View | A11y.Group |
322
- | --------------------------------------------------------- | ------------------------------------------------------------- |
323
- | <img src="/.github/images/horizontal-scroll-view.gif" height="500" /> | <img src="/.github/images/horizontal-scroll-group.gif" height="500" /> |
59
+ - [Getting started](./docs/getting-started/getting-started.md)
60
+ - [Component overview](./docs/guides/overview.md)
61
+ - [Guides](./docs/README.md#guides)
62
+ - [Component API reference](./docs/components/overview.md)
63
+ - [Migration guide](./docs/migration/migration.md)
324
64
 
325
- ```js
326
- import { A11y, IndexCommands } from 'react-native-a11y-order';
65
+ ---
327
66
 
328
- // ...
67
+ ## Roadmap
329
68
 
330
- export default function App() {
331
- return (
332
- <ScrollView
333
- style={styles.slider}
334
- contentContainerStyle={styles.sliderContainer}
335
- horizontal
336
- >
337
- <A11y.Group style={styles.slide}>
338
- <View>
339
- <Text>Title: 1</Text>
340
- </View>
341
- <View>
342
- <Text>Description: 1</Text>
343
- </View>
344
- </A11y.Group>
345
- <A11y.Group style={styles.slide}>
346
- <View>
347
- <Text>Title: 2</Text>
348
- </View>
349
- <View>
350
- <Text>Description: 2</Text>
351
- </View>
352
- </A11y.Group>
353
- </ScrollView>
354
- );
355
- }
356
- ```
69
+ All planned features are implemented and released. No new functionality or API changes are planned.
357
70
 
71
+ Future work is limited to:
72
+ - React Native version support (new releases)
73
+ - Bug fixes and issue resolution
358
74
 
359
- | Props | Description |
360
- | :-- | :-- |
361
- | ViewProps | Default view props, including style, testID, etc. |
362
- | type?: | `legacy` or `none` \| `table` \| `list` \| `landmark` \| `group` — representation of `UIAccessibilityContainerType`. The default value is `none`. |
75
+ Both active versions receive fixes:
363
76
 
77
+ | Version | React Native | Status |
78
+ | :-- | :-- | :-- |
79
+ | `1.0.0` | ≥ 0.80 | Active — bug fixes and new RN support |
80
+ | `0.11.0` | ≤ 0.79 | Active — bug fixes only |
364
81
 
365
- ## Roadmap
366
- * Add autofocus prop
367
- * Refactor and optimize performance
368
- * Add documentation and descriptive examples
82
+ ---
369
83
 
370
84
  ## Contributing
371
85
 
@@ -2,13 +2,11 @@ package com.a11yorder;
2
2
 
3
3
 
4
4
  import com.a11yorder.modules.A11yAnnounceModule;
5
- import com.a11yorder.views.A11yUIContainerView.A11yUIContainerViewManager;
6
- import com.a11yorder.views.A11yGroupView.A11yGroupViewManager;
5
+ import com.a11yorder.views.A11yCardView.A11yCardViewManager;
7
6
  import com.a11yorder.views.A11yIndexView.A11yIndexViewManager;
8
7
  import com.a11yorder.views.A11yLockView.A11yLockViewManager;
9
8
  import com.a11yorder.views.A11yOrderView.A11yOrderViewManager;
10
9
  import com.a11yorder.views.A11yPaneTitle.A11yPaneTitleManager;
11
- import com.a11yorder.views.A11yView.A11yViewManager;
12
10
  import com.facebook.react.module.model.ReactModuleInfo;
13
11
  import com.facebook.react.module.model.ReactModuleInfoProvider;
14
12
  import com.facebook.react.uimanager.ViewManager;
@@ -29,11 +27,9 @@ public class A11yOrderPackage extends TurboReactPackage {
29
27
  List<ViewManager> viewManagers = new ArrayList<>();
30
28
  viewManagers.add(new A11yIndexViewManager());
31
29
  viewManagers.add(new A11yOrderViewManager());
32
- viewManagers.add(new A11yGroupViewManager());
33
- viewManagers.add(new A11yUIContainerViewManager());
34
30
  viewManagers.add(new A11yPaneTitleManager());
35
- viewManagers.add(new A11yViewManager());
36
31
  viewManagers.add(new A11yLockViewManager());
32
+ viewManagers.add(new A11yCardViewManager());
37
33
 
38
34
  return viewManagers;
39
35
  }
@@ -0,0 +1,61 @@
1
+ package com.a11yorder.core;
2
+
3
+ import android.content.Context;
4
+ import android.view.View;
5
+ import android.view.accessibility.AccessibilityEvent;
6
+
7
+ import com.a11yorder.services.focus.A11yFocusDelegate;
8
+ import com.a11yorder.services.focus.A11yFocusProtocol;
9
+ import com.facebook.react.bridge.ReactContext;
10
+
11
+ public class A11yAutoFocusView extends A11yScreenReaderView implements A11yFocusProtocol {
12
+ private final A11yFocusDelegate a11yFocusDelegate;
13
+ private Boolean autoFocus = false;
14
+ private Boolean autoFocusOnce = false;
15
+ private Boolean hasBeenFocused = false;
16
+
17
+ public A11yAutoFocusView(Context context) {
18
+ super(context);
19
+ this.a11yFocusDelegate = new A11yFocusDelegate((ReactContext) context, this);
20
+ }
21
+
22
+ @Override
23
+ public boolean isViewFocused() {
24
+ View focusTarget = this.isFocusable() ? this : this.getSubChild();
25
+ if (focusTarget == null) return false;
26
+ return focusTarget.isAccessibilityFocused();
27
+ }
28
+
29
+ public void setAutoFocus(Boolean value) {
30
+ this.autoFocus = value;
31
+ }
32
+
33
+ public void focus() {
34
+ a11yFocusDelegate.requestFocus();
35
+ }
36
+
37
+ @Override
38
+ public boolean onRequestSendAccessibilityEvent(View child, AccessibilityEvent event) {
39
+ int eventType = event.getEventType();
40
+
41
+ if (eventType == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED && autoFocus && !hasBeenFocused) {
42
+ hasBeenFocused = true;
43
+ a11yFocusDelegate.onFocused();
44
+ }
45
+
46
+ return super.onRequestSendAccessibilityEvent(child, event);
47
+ }
48
+
49
+ @Override
50
+ protected void onAttachedToWindow() {
51
+ super.onAttachedToWindow();
52
+ if (autoFocus && !autoFocusOnce) {
53
+ autoFocusOnce = true;
54
+
55
+ if (!isViewFocused()) {
56
+ hasBeenFocused = false;
57
+ a11yFocusDelegate.requestFocus();
58
+ }
59
+ }
60
+ }
61
+ }
@@ -1,28 +1,18 @@
1
- package com.a11yorder.views.A11yView;
2
-
1
+ package com.a11yorder.core;
3
2
 
4
3
  import android.content.Context;
5
4
  import android.view.View;
6
5
  import android.view.accessibility.AccessibilityEvent;
7
6
 
8
- import com.a11yorder.core.A11yViewGroup;
9
7
  import com.a11yorder.events.EventHelper;
10
- import com.a11yorder.services.focus.A11yFocusDelegate;
11
- import com.a11yorder.services.focus.A11yFocusProtocol;
12
8
  import com.facebook.react.bridge.ReactContext;
13
9
 
14
- public class A11yView extends A11yViewGroup implements A11yFocusProtocol {
10
+ public class A11yScreenReaderView extends A11yViewGroup {
15
11
  private final Context context;
16
- private final A11yFocusDelegate a11yFocusDelegate;
17
- private Boolean autoFocus = false;
18
-
19
- private Boolean autoFocusOnce = false;
20
- private Boolean hasBeenFocused = false;
21
12
 
22
- public A11yView(Context context) {
13
+ public A11yScreenReaderView(Context context) {
23
14
  super(context);
24
15
  this.context = context;
25
- this.a11yFocusDelegate = new A11yFocusDelegate((ReactContext) context, this);
26
16
  }
27
17
 
28
18
  public static String getNativeIdSafe(View view) {
@@ -34,20 +24,6 @@ public class A11yView extends A11yViewGroup implements A11yFocusProtocol {
34
24
  }
35
25
  }
36
26
 
37
- public boolean isViewFocused() {
38
- View focusTarget = this.isFocusable() ? this : this.getChildAt(0);
39
- if (focusTarget == null) return false;
40
- return focusTarget.isAccessibilityFocused();
41
- }
42
-
43
- public void setAutoFocus(Boolean value) {
44
- this.autoFocus = value;
45
- }
46
-
47
- public void focus() {
48
- a11yFocusDelegate.requestFocus();
49
- }
50
-
51
27
  @Override
52
28
  public void onPopulateAccessibilityEvent(AccessibilityEvent event) {
53
29
  super.onPopulateAccessibilityEvent(event);
@@ -62,11 +38,6 @@ public class A11yView extends A11yViewGroup implements A11yFocusProtocol {
62
38
  int eventType = event.getEventType();
63
39
  boolean isSubChild = (child == this.getSubChild());
64
40
 
65
- if (eventType == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED && autoFocus && !hasBeenFocused) {
66
- hasBeenFocused = true;
67
- a11yFocusDelegate.onFocused();
68
- }
69
-
70
41
  if (eventType == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED && isSubChild) {
71
42
  EventHelper.screenReaderFocusChanged((ReactContext) context, this.getId(), true);
72
43
  }
@@ -87,17 +58,4 @@ public class A11yView extends A11yViewGroup implements A11yFocusProtocol {
87
58
 
88
59
  return super.onRequestSendAccessibilityEvent(child, event);
89
60
  }
90
-
91
- @Override
92
- protected void onAttachedToWindow() {
93
- super.onAttachedToWindow();
94
- if (autoFocus && !autoFocusOnce) {
95
- autoFocusOnce = true;
96
-
97
- if (!isViewFocused()) {
98
- hasBeenFocused = false;
99
- a11yFocusDelegate.requestFocus();
100
- }
101
- }
102
- }
103
61
  }
@@ -0,0 +1,37 @@
1
+ package com.a11yorder.core;
2
+
3
+ import android.content.Context;
4
+ import android.view.View;
5
+
6
+ import com.a11yorder.services.order.A11yOrderService;
7
+
8
+ public class A11yViewOrder extends A11yAutoFocusView {
9
+ private final A11yOrderService orderService;
10
+
11
+ public A11yViewOrder(Context context) {
12
+ super(context);
13
+ this.orderService = new A11yOrderService(this);
14
+ }
15
+
16
+ public void setIndex(int index) {
17
+ this.orderService.setIndex(index);
18
+ }
19
+
20
+ public void setOrderFocusType(int focusType) {
21
+ this.orderService.setFocusType(focusType);
22
+ }
23
+
24
+ public void setOrderKey(String orderKey) {
25
+ this.orderService.setOrderKey(orderKey);
26
+ }
27
+
28
+ @Override
29
+ protected void onChildAttached(View child) {
30
+ this.orderService.link(child);
31
+ }
32
+
33
+ @Override
34
+ protected void onChildRemoved() {
35
+ this.orderService.detach();
36
+ }
37
+ }
@@ -0,0 +1,18 @@
1
+ package com.a11yorder.views.A11yCardView;
2
+
3
+
4
+
5
+ import android.view.ViewGroup;
6
+
7
+ import com.facebook.react.module.annotations.ReactModule;
8
+ import com.facebook.react.uimanager.ThemedReactContext;
9
+
10
+ @ReactModule(name = com.a11yorder.views.A11yCardView.A11yCardViewManager.NAME)
11
+ public class A11yCardViewManager extends com.a11yorder.A11yCardViewManagerSpec<ViewGroup> {
12
+ public static final String NAME = "A11yCardView";
13
+
14
+ @Override
15
+ public String getName() {
16
+ return NAME;
17
+ }
18
+ }