react-native-a11y-order 0.9.1 → 0.11.0-alpha.0
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.
- package/README.md +35 -345
- package/android/src/main/java/com/a11yorder/A11yOrderPackage.java +2 -6
- package/android/src/main/java/com/a11yorder/core/A11yAutoFocusView.java +61 -0
- package/android/src/main/java/com/a11yorder/{views/A11yView/A11yView.java → core/A11yScreenReaderView.java} +3 -45
- package/android/src/main/java/com/a11yorder/core/A11yViewOrder.java +37 -0
- package/android/src/main/java/com/a11yorder/views/A11yCardView/A11yCardViewManager.java +18 -0
- package/android/src/main/java/com/a11yorder/views/A11yIndexView/A11yIndexView.java +2 -65
- package/android/src/main/java/com/a11yorder/views/A11yIndexView/A11yIndexViewManager.java +27 -0
- package/android/src/newarch/A11yCardViewManagerSpec.java +9 -0
- package/android/src/oldarch/A11yCardViewManagerSpec.java +8 -0
- package/android/src/oldarch/A11yIndexViewManagerSpec.java +9 -0
- package/ios/helpers/RNAOFabricEventHelper/RNAOFabricEventHelper.mm +5 -5
- package/ios/views/RNAOA11yCardView/RNAOA11yCardView.h +29 -0
- package/ios/views/RNAOA11yCardView/RNAOA11yCardView.mm +83 -0
- package/ios/views/RNAOA11yCardView/RNAOA11yCardViewManager.h +14 -0
- package/ios/views/RNAOA11yCardView/RNAOA11yCardViewManager.mm +17 -0
- package/ios/views/RNAOA11yIndexView/RNAOA11yIndexView.h +2 -41
- package/ios/views/RNAOA11yIndexView/RNAOA11yIndexView.mm +27 -127
- package/ios/views/RNAOA11yIndexView/RNAOA11yIndexViewManager.mm +21 -0
- package/ios/views/base/RNAOA11yAutoFocusView.h +30 -0
- package/ios/views/{RNAOA11yView/RNAOA11yView.mm → base/RNAOA11yAutoFocusView.mm} +66 -168
- package/ios/views/base/RNAOA11yGroupChildrenView.h +21 -0
- package/ios/views/base/RNAOA11yGroupChildrenView.mm +19 -0
- package/ios/views/base/RNAOA11yScreenReaderView.h +24 -0
- package/ios/views/base/RNAOA11yScreenReaderView.mm +32 -0
- package/ios/views/base/RNAOA11yViewGroup.h +35 -0
- package/ios/views/base/RNAOA11yViewGroup.mm +46 -0
- package/ios/views/base/RNAOA11yViewOrder.h +40 -0
- package/ios/views/base/RNAOA11yViewOrder.mm +92 -0
- package/lib/commonjs/components/A11yCard/A11yCard.ios.js +49 -0
- package/lib/commonjs/components/A11yCard/A11yCard.ios.js.map +1 -0
- package/lib/commonjs/components/A11yCard/A11yCard.js +41 -0
- package/lib/commonjs/components/A11yCard/A11yCard.js.map +1 -0
- package/lib/commonjs/{types/A11yGroup.types.js → components/A11yCard/A11yCard.types.js} +1 -1
- package/lib/commonjs/components/A11yCard/A11yCard.types.js.map +1 -0
- package/lib/commonjs/components/A11yIndex/A11yIndex.js +88 -28
- package/lib/commonjs/components/A11yIndex/A11yIndex.js.map +1 -1
- package/lib/commonjs/components/A11yIndex/A11yIndex.types.js +39 -0
- package/lib/commonjs/components/A11yIndex/A11yIndex.types.js.map +1 -0
- package/lib/commonjs/components/A11yIndex/A11yIndex.web.js.map +1 -1
- package/lib/commonjs/components/A11yLock/A11yFocusFrame/A11yFocusFrame.js.map +1 -1
- package/lib/commonjs/components/A11yLock/A11yFocusTrap/A11yFocusTrap.js.map +1 -1
- package/lib/commonjs/components/A11yLock/A11yLock.types.js.map +1 -0
- package/lib/commonjs/components/{A11ySequence/A11ySequence.js → A11yOrder/A11yOrder.js} +3 -3
- package/lib/commonjs/components/A11yOrder/A11yOrder.js.map +1 -0
- package/lib/commonjs/{types/A11yModule.types.js → components/A11yOrder/A11yOrder.types.js} +1 -1
- package/lib/commonjs/components/A11yOrder/A11yOrder.types.js.map +1 -0
- package/lib/commonjs/components/A11yPaneTitle/A11yPaneTitle.js +6 -7
- package/lib/commonjs/components/A11yPaneTitle/A11yPaneTitle.js.map +1 -1
- package/lib/commonjs/components/A11yPaneTitle/A11yPaneTitle.types.js +6 -0
- package/lib/commonjs/components/A11yPaneTitle/A11yPaneTitle.types.js.map +1 -0
- package/lib/commonjs/components/A11yView/A11yView.js +7 -33
- package/lib/commonjs/components/A11yView/A11yView.js.map +1 -1
- package/lib/commonjs/components/A11yView/A11yView.types.js.map +1 -0
- package/lib/commonjs/index.js +17 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +10 -4
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/nativeSpecs/{A11yGroupNativeComponent.ts → A11yCardNativeComponent.ts} +3 -3
- package/lib/commonjs/nativeSpecs/A11yIndexNativeComponent.ts +12 -3
- package/lib/module/components/A11yCard/A11yCard.ios.js +43 -0
- package/lib/module/components/A11yCard/A11yCard.ios.js.map +1 -0
- package/lib/module/components/A11yCard/A11yCard.js +35 -0
- package/lib/module/components/A11yCard/A11yCard.js.map +1 -0
- package/lib/module/components/A11yCard/A11yCard.types.js +4 -0
- package/lib/module/components/A11yCard/A11yCard.types.js.map +1 -0
- package/lib/module/components/A11yIndex/A11yIndex.js +88 -28
- package/lib/module/components/A11yIndex/A11yIndex.js.map +1 -1
- package/lib/module/components/A11yIndex/A11yIndex.types.js +35 -0
- package/lib/module/components/A11yIndex/A11yIndex.types.js.map +1 -0
- package/lib/module/components/A11yIndex/A11yIndex.web.js.map +1 -1
- package/lib/module/components/A11yLock/A11yFocusFrame/A11yFocusFrame.js.map +1 -1
- package/lib/module/components/A11yLock/A11yFocusTrap/A11yFocusTrap.js.map +1 -1
- package/lib/module/components/A11yLock/A11yLock.types.js.map +1 -0
- package/lib/module/components/{A11ySequence/A11ySequence.js → A11yOrder/A11yOrder.js} +2 -2
- package/lib/module/components/A11yOrder/A11yOrder.js.map +1 -0
- package/lib/module/components/A11yOrder/A11yOrder.types.js +4 -0
- package/lib/module/components/A11yOrder/A11yOrder.types.js.map +1 -0
- package/lib/module/components/A11yPaneTitle/A11yPaneTitle.js +6 -7
- package/lib/module/components/A11yPaneTitle/A11yPaneTitle.js.map +1 -1
- package/lib/module/components/A11yPaneTitle/A11yPaneTitle.types.js +4 -0
- package/lib/module/components/A11yPaneTitle/A11yPaneTitle.types.js.map +1 -0
- package/lib/module/components/A11yView/A11yView.js +7 -31
- package/lib/module/components/A11yView/A11yView.js.map +1 -1
- package/lib/module/components/A11yView/A11yView.types.js.map +1 -0
- package/lib/module/index.js +12 -8
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +4 -4
- package/lib/module/index.web.js.map +1 -1
- package/{src/nativeSpecs/A11yGroupNativeComponent.ts → lib/module/nativeSpecs/A11yCardNativeComponent.ts} +3 -3
- package/lib/module/nativeSpecs/A11yIndexNativeComponent.ts +12 -3
- package/lib/typescript/src/components/A11yCard/A11yCard.d.ts +5 -0
- package/lib/typescript/src/components/A11yCard/A11yCard.d.ts.map +1 -0
- package/lib/typescript/src/components/A11yCard/A11yCard.ios.d.ts +5 -0
- package/lib/typescript/src/components/A11yCard/A11yCard.ios.d.ts.map +1 -0
- package/lib/typescript/src/components/A11yCard/A11yCard.types.d.ts +14 -0
- package/lib/typescript/src/components/A11yCard/A11yCard.types.d.ts.map +1 -0
- package/lib/typescript/src/components/A11yIndex/A11yIndex.d.ts +15 -10
- package/lib/typescript/src/components/A11yIndex/A11yIndex.d.ts.map +1 -1
- package/lib/typescript/src/components/A11yIndex/A11yIndex.types.d.ts +83 -0
- package/lib/typescript/src/components/A11yIndex/A11yIndex.types.d.ts.map +1 -0
- package/lib/typescript/src/components/A11yIndex/A11yIndex.web.d.ts +14 -10
- package/lib/typescript/src/components/A11yIndex/A11yIndex.web.d.ts.map +1 -1
- package/lib/typescript/src/components/A11yLock/A11yBaseLock/A11yBaseLock.d.ts +1 -1
- package/lib/typescript/src/components/A11yLock/A11yBaseLock/A11yBaseLock.d.ts.map +1 -1
- package/lib/typescript/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.android.d.ts +1 -1
- package/lib/typescript/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.android.d.ts.map +1 -1
- package/lib/typescript/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.d.ts +2 -2
- package/lib/typescript/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.d.ts.map +1 -1
- package/lib/typescript/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.android.d.ts +1 -1
- package/lib/typescript/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.android.d.ts.map +1 -1
- package/lib/typescript/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.d.ts +2 -2
- package/lib/typescript/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.d.ts.map +1 -1
- package/lib/typescript/src/components/A11yLock/A11yLock.types.d.ts +31 -0
- package/lib/typescript/src/components/A11yLock/A11yLock.types.d.ts.map +1 -0
- package/lib/typescript/src/components/{A11ySequence/A11ySequence.d.ts → A11yOrder/A11yOrder.d.ts} +4 -2
- package/lib/typescript/src/components/A11yOrder/A11yOrder.d.ts.map +1 -0
- package/lib/typescript/src/components/A11yOrder/A11yOrder.types.d.ts +11 -0
- package/lib/typescript/src/components/A11yOrder/A11yOrder.types.d.ts.map +1 -0
- package/lib/typescript/src/components/A11yPaneTitle/A11yPaneTitle.d.ts +3 -17
- package/lib/typescript/src/components/A11yPaneTitle/A11yPaneTitle.d.ts.map +1 -1
- package/lib/typescript/src/components/A11yPaneTitle/A11yPaneTitle.types.d.ts +43 -0
- package/lib/typescript/src/components/A11yPaneTitle/A11yPaneTitle.types.d.ts.map +1 -0
- package/lib/typescript/src/components/A11yView/A11yView.d.ts +13 -6
- package/lib/typescript/src/components/A11yView/A11yView.d.ts.map +1 -1
- package/lib/typescript/src/components/A11yView/A11yView.types.d.ts +10 -0
- package/lib/typescript/src/components/A11yView/A11yView.types.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +32 -36
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/index.web.d.ts +22 -22
- package/lib/typescript/src/index.web.d.ts.map +1 -1
- package/lib/typescript/src/nativeSpecs/A11yCardNativeComponent.d.ts +8 -0
- package/lib/typescript/src/nativeSpecs/A11yCardNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/nativeSpecs/A11yIndexNativeComponent.d.ts +10 -3
- package/lib/typescript/src/nativeSpecs/A11yIndexNativeComponent.d.ts.map +1 -1
- package/package.json +12 -11
- package/src/components/A11yCard/A11yCard.ios.tsx +44 -0
- package/src/components/A11yCard/A11yCard.tsx +35 -0
- package/src/components/A11yCard/A11yCard.types.ts +39 -0
- package/src/components/A11yIndex/A11yIndex.tsx +144 -52
- package/src/components/A11yIndex/A11yIndex.types.ts +102 -0
- package/src/components/A11yIndex/A11yIndex.web.tsx +12 -17
- package/src/components/A11yLock/A11yBaseLock/A11yBaseLock.tsx +1 -1
- package/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.android.tsx +1 -1
- package/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.tsx +3 -2
- package/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.android.tsx +1 -1
- package/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.tsx +2 -2
- package/src/components/A11yLock/A11yLock.types.ts +34 -0
- package/src/components/{A11ySequence/A11ySequence.tsx → A11yOrder/A11yOrder.tsx} +4 -2
- package/src/components/A11yOrder/A11yOrder.types.ts +11 -0
- package/src/components/A11yPaneTitle/A11yPaneTitle.tsx +13 -19
- package/src/components/A11yPaneTitle/A11yPaneTitle.types.ts +49 -0
- package/src/components/A11yView/A11yView.tsx +8 -63
- package/src/components/A11yView/A11yView.types.ts +11 -0
- package/src/index.ts +26 -19
- package/src/index.web.ts +6 -13
- package/{lib/module/nativeSpecs/A11yGroupNativeComponent.ts → src/nativeSpecs/A11yCardNativeComponent.ts} +3 -3
- package/src/nativeSpecs/A11yIndexNativeComponent.ts +12 -3
- package/android/src/main/java/com/a11yorder/views/A11yGroupView/A11yGroupViewManager.java +0 -25
- package/android/src/main/java/com/a11yorder/views/A11yUIContainerView/A11yUIContainerViewManager.java +0 -30
- package/android/src/main/java/com/a11yorder/views/A11yView/A11yViewManager.java +0 -67
- package/android/src/newarch/A11yGroupViewManagerSpec.java +0 -9
- package/android/src/newarch/A11yUIContainerViewManagerSpec.java +0 -8
- package/android/src/newarch/A11yViewSpec.java +0 -13
- package/android/src/oldarch/A11yGroupViewManagerSpec.java +0 -8
- package/android/src/oldarch/A11yUIContainerViewManagerSpec.java +0 -9
- package/android/src/oldarch/A11yViewSpec.java +0 -18
- package/ios/views/RNAOA11yGroupView/RNAOA11yGroupView.h +0 -37
- package/ios/views/RNAOA11yGroupView/RNAOA11yGroupView.mm +0 -67
- package/ios/views/RNAOA11yGroupView/RNAOA11yGroupViewManager.h +0 -18
- package/ios/views/RNAOA11yGroupView/RNAOA11yGroupViewManager.mm +0 -25
- package/ios/views/RNAOA11yUIContainerView/RNAOA11yUIContainerView.h +0 -35
- package/ios/views/RNAOA11yUIContainerView/RNAOA11yUIContainerView.mm +0 -79
- package/ios/views/RNAOA11yUIContainerView/RNAOA11yUIContainerViewManager.h +0 -18
- package/ios/views/RNAOA11yUIContainerView/RNAOA11yUIContainerViewManager.mm +0 -27
- package/ios/views/RNAOA11yView/RNAOA11yView.h +0 -45
- package/ios/views/RNAOA11yView/RNAOA11yViewManager.h +0 -14
- package/ios/views/RNAOA11yView/RNAOA11yViewManager.mm +0 -53
- package/lib/commonjs/components/A11yGroup/A11yGroup.android.js +0 -18
- package/lib/commonjs/components/A11yGroup/A11yGroup.android.js.map +0 -1
- package/lib/commonjs/components/A11yGroup/A11yGroup.ios.js +0 -24
- package/lib/commonjs/components/A11yGroup/A11yGroup.ios.js.map +0 -1
- package/lib/commonjs/components/A11yGroup/A11yGroup.js +0 -9
- package/lib/commonjs/components/A11yGroup/A11yGroup.js.map +0 -1
- package/lib/commonjs/components/A11ySequence/A11ySequence.js.map +0 -1
- package/lib/commonjs/components/A11yUIContainer/A11yUIContainer.ios.js +0 -22
- package/lib/commonjs/components/A11yUIContainer/A11yUIContainer.ios.js.map +0 -1
- package/lib/commonjs/components/A11yUIContainer/A11yUIContainer.js +0 -9
- package/lib/commonjs/components/A11yUIContainer/A11yUIContainer.js.map +0 -1
- package/lib/commonjs/nativeSpecs/A11yUIContainerNativeComponent.ts +0 -12
- package/lib/commonjs/nativeSpecs/A11yViewNativeComponent.ts +0 -36
- package/lib/commonjs/types/A11yGroup.types.js.map +0 -1
- package/lib/commonjs/types/A11yIndex.types.js +0 -13
- package/lib/commonjs/types/A11yIndex.types.js.map +0 -1
- package/lib/commonjs/types/A11yLock.types.js.map +0 -1
- package/lib/commonjs/types/A11yModule.types.js.map +0 -1
- package/lib/commonjs/types/A11yUIContainerView.types.js +0 -15
- package/lib/commonjs/types/A11yUIContainerView.types.js.map +0 -1
- package/lib/commonjs/types/A11yView.types.js.map +0 -1
- package/lib/module/components/A11yGroup/A11yGroup.android.js +0 -12
- package/lib/module/components/A11yGroup/A11yGroup.android.js.map +0 -1
- package/lib/module/components/A11yGroup/A11yGroup.ios.js +0 -18
- package/lib/module/components/A11yGroup/A11yGroup.ios.js.map +0 -1
- package/lib/module/components/A11yGroup/A11yGroup.js +0 -5
- package/lib/module/components/A11yGroup/A11yGroup.js.map +0 -1
- package/lib/module/components/A11ySequence/A11ySequence.js.map +0 -1
- package/lib/module/components/A11yUIContainer/A11yUIContainer.ios.js +0 -17
- package/lib/module/components/A11yUIContainer/A11yUIContainer.ios.js.map +0 -1
- package/lib/module/components/A11yUIContainer/A11yUIContainer.js +0 -5
- package/lib/module/components/A11yUIContainer/A11yUIContainer.js.map +0 -1
- package/lib/module/nativeSpecs/A11yUIContainerNativeComponent.ts +0 -12
- package/lib/module/nativeSpecs/A11yViewNativeComponent.ts +0 -36
- package/lib/module/types/A11yGroup.types.js +0 -4
- package/lib/module/types/A11yGroup.types.js.map +0 -1
- package/lib/module/types/A11yIndex.types.js +0 -9
- package/lib/module/types/A11yIndex.types.js.map +0 -1
- package/lib/module/types/A11yLock.types.js.map +0 -1
- package/lib/module/types/A11yModule.types.js +0 -4
- package/lib/module/types/A11yModule.types.js.map +0 -1
- package/lib/module/types/A11yUIContainerView.types.js +0 -11
- package/lib/module/types/A11yUIContainerView.types.js.map +0 -1
- package/lib/module/types/A11yView.types.js.map +0 -1
- package/lib/typescript/src/components/A11yGroup/A11yGroup.android.d.ts +0 -4
- package/lib/typescript/src/components/A11yGroup/A11yGroup.android.d.ts.map +0 -1
- package/lib/typescript/src/components/A11yGroup/A11yGroup.d.ts +0 -3
- package/lib/typescript/src/components/A11yGroup/A11yGroup.d.ts.map +0 -1
- package/lib/typescript/src/components/A11yGroup/A11yGroup.ios.d.ts +0 -4
- package/lib/typescript/src/components/A11yGroup/A11yGroup.ios.d.ts.map +0 -1
- package/lib/typescript/src/components/A11ySequence/A11ySequence.d.ts.map +0 -1
- package/lib/typescript/src/components/A11yUIContainer/A11yUIContainer.d.ts +0 -3
- package/lib/typescript/src/components/A11yUIContainer/A11yUIContainer.d.ts.map +0 -1
- package/lib/typescript/src/components/A11yUIContainer/A11yUIContainer.ios.d.ts +0 -4
- package/lib/typescript/src/components/A11yUIContainer/A11yUIContainer.ios.d.ts.map +0 -1
- package/lib/typescript/src/nativeSpecs/A11yGroupNativeComponent.d.ts +0 -8
- package/lib/typescript/src/nativeSpecs/A11yGroupNativeComponent.d.ts.map +0 -1
- package/lib/typescript/src/nativeSpecs/A11yUIContainerNativeComponent.d.ts +0 -10
- package/lib/typescript/src/nativeSpecs/A11yUIContainerNativeComponent.d.ts.map +0 -1
- package/lib/typescript/src/nativeSpecs/A11yViewNativeComponent.d.ts +0 -26
- package/lib/typescript/src/nativeSpecs/A11yViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/src/types/A11yGroup.types.d.ts +0 -7
- package/lib/typescript/src/types/A11yGroup.types.d.ts.map +0 -1
- package/lib/typescript/src/types/A11yIndex.types.d.ts +0 -19
- package/lib/typescript/src/types/A11yIndex.types.d.ts.map +0 -1
- package/lib/typescript/src/types/A11yLock.types.d.ts +0 -8
- package/lib/typescript/src/types/A11yLock.types.d.ts.map +0 -1
- package/lib/typescript/src/types/A11yModule.types.d.ts +0 -7
- package/lib/typescript/src/types/A11yModule.types.d.ts.map +0 -1
- package/lib/typescript/src/types/A11yUIContainerView.types.d.ts +0 -13
- package/lib/typescript/src/types/A11yUIContainerView.types.d.ts.map +0 -1
- package/lib/typescript/src/types/A11yView.types.d.ts +0 -12
- package/lib/typescript/src/types/A11yView.types.d.ts.map +0 -1
- package/src/components/A11yGroup/A11yGroup.android.tsx +0 -8
- package/src/components/A11yGroup/A11yGroup.ios.tsx +0 -11
- package/src/components/A11yGroup/A11yGroup.tsx +0 -5
- package/src/components/A11yUIContainer/A11yUIContainer.ios.tsx +0 -20
- package/src/components/A11yUIContainer/A11yUIContainer.tsx +0 -5
- package/src/nativeSpecs/A11yUIContainerNativeComponent.ts +0 -12
- package/src/nativeSpecs/A11yViewNativeComponent.ts +0 -36
- package/src/types/A11yGroup.types.ts +0 -9
- package/src/types/A11yIndex.types.ts +0 -21
- package/src/types/A11yLock.types.ts +0 -8
- package/src/types/A11yModule.types.ts +0 -7
- package/src/types/A11yUIContainerView.types.ts +0 -15
- package/src/types/A11yView.types.ts +0 -19
- /package/lib/commonjs/{types → components/A11yLock}/A11yLock.types.js +0 -0
- /package/lib/commonjs/{types → components/A11yView}/A11yView.types.js +0 -0
- /package/lib/module/{types → components/A11yLock}/A11yLock.types.js +0 -0
- /package/lib/module/{types → components/A11yView}/A11yView.types.js +0 -0
|
@@ -1,74 +1,11 @@
|
|
|
1
1
|
package com.a11yorder.views.A11yIndexView;
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
|
-
import android.view.View;
|
|
5
|
-
import android.view.accessibility.AccessibilityEvent;
|
|
6
4
|
|
|
7
|
-
import com.a11yorder.
|
|
8
|
-
import com.a11yorder.services.order.A11yOrderService;
|
|
9
|
-
import com.facebook.react.bridge.ReactContext;
|
|
10
|
-
import com.facebook.react.views.view.ReactViewGroup;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
public class A11yIndexView extends ReactViewGroup {
|
|
14
|
-
private final Context context;
|
|
15
|
-
private final A11yOrderService orderService;
|
|
5
|
+
import com.a11yorder.core.A11yViewOrder;
|
|
16
6
|
|
|
7
|
+
public class A11yIndexView extends A11yViewOrder {
|
|
17
8
|
public A11yIndexView(Context context) {
|
|
18
9
|
super(context);
|
|
19
|
-
this.context = context;
|
|
20
|
-
this.orderService = new A11yOrderService(this);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
public void setIndex(int index) {
|
|
24
|
-
this.orderService.setIndex(index);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
public void setOrderFocusType(int focusType) {
|
|
28
|
-
this.orderService.setFocusType(focusType);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
public void setOrderKey(String orderKey) {
|
|
32
|
-
this.orderService.setOrderKey(orderKey);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@Override
|
|
36
|
-
public void onViewAdded(View child) {
|
|
37
|
-
super.onViewAdded(child);
|
|
38
|
-
this.orderService.link(child);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@Override
|
|
42
|
-
public void onViewRemoved(View child) {
|
|
43
|
-
super.onViewRemoved(child);
|
|
44
|
-
this.orderService.clear(child);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
@Override
|
|
48
|
-
protected void onAttachedToWindow() {
|
|
49
|
-
super.onAttachedToWindow();
|
|
50
|
-
this.orderService.attach();
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
@Override
|
|
54
|
-
protected void onDetachedFromWindow() {
|
|
55
|
-
super.onDetachedFromWindow();
|
|
56
|
-
this.orderService.detach();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
@Override
|
|
60
|
-
public boolean onRequestSendAccessibilityEvent(View child, AccessibilityEvent event) {
|
|
61
|
-
int eventType = event.getEventType();
|
|
62
|
-
boolean isSubChild = (child == orderService.getStoredView());
|
|
63
|
-
|
|
64
|
-
if (eventType == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED && isSubChild) {
|
|
65
|
-
EventHelper.screenReaderFocusChanged((ReactContext) context, this.getId(), true);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (eventType == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED && isSubChild) {
|
|
69
|
-
EventHelper.screenReaderFocusChanged((ReactContext) context, this.getId(), false);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return super.onRequestSendAccessibilityEvent(child, event);
|
|
73
10
|
}
|
|
74
11
|
}
|
|
@@ -6,7 +6,9 @@ import androidx.annotation.NonNull;
|
|
|
6
6
|
import androidx.annotation.Nullable;
|
|
7
7
|
|
|
8
8
|
import com.a11yorder.events.EventHelper;
|
|
9
|
+
import com.a11yorder.events.ScreenReaderDescendantFocusChangedEvent;
|
|
9
10
|
import com.a11yorder.events.ScreenReaderFocusChangedEvent;
|
|
11
|
+
import com.a11yorder.events.ScreenReaderFocusedEvent;
|
|
10
12
|
import com.a11yorder.utils.A11yHelper;
|
|
11
13
|
import com.facebook.react.bridge.ReadableArray;
|
|
12
14
|
import com.facebook.react.module.annotations.ReactModule;
|
|
@@ -53,6 +55,11 @@ public class A11yIndexViewManager extends com.a11yorder.A11yIndexViewManagerSpec
|
|
|
53
55
|
viewGroup.setOrderFocusType(value);
|
|
54
56
|
}
|
|
55
57
|
|
|
58
|
+
@Override
|
|
59
|
+
public void setShouldGroupAccessibilityChildren(A11yIndexView view, int value) {
|
|
60
|
+
//stub
|
|
61
|
+
}
|
|
62
|
+
|
|
56
63
|
@Override
|
|
57
64
|
public void focus(A11yIndexView view) {
|
|
58
65
|
this.focus((ReactViewGroup) view);
|
|
@@ -72,11 +79,31 @@ public class A11yIndexViewManager extends com.a11yorder.A11yIndexViewManagerSpec
|
|
|
72
79
|
}
|
|
73
80
|
}
|
|
74
81
|
|
|
82
|
+
|
|
83
|
+
@Override
|
|
84
|
+
@ReactProp(name = "autoFocus")
|
|
85
|
+
public void setAutoFocus(A11yIndexView view, boolean value) {
|
|
86
|
+
view.setAutoFocus(value);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@Override
|
|
90
|
+
public void setDescendantFocusChangedEnabled(A11yIndexView view, boolean value) {
|
|
91
|
+
//stub
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@Override
|
|
95
|
+
public void setContainerType(A11yIndexView view, int value) {
|
|
96
|
+
//stub
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@javax.annotation.Nullable
|
|
75
100
|
@Override
|
|
76
101
|
public Map<String, Object> getExportedCustomDirectEventTypeConstants() {
|
|
77
102
|
Map<String, Object> export = new HashMap<>();
|
|
78
103
|
|
|
104
|
+
export.put(ScreenReaderFocusedEvent.EVENT_NAME, EventHelper.buildDirectEventMap("onScreenReaderFocused"));
|
|
79
105
|
export.put(ScreenReaderFocusChangedEvent.EVENT_NAME, EventHelper.buildDirectEventMap("onScreenReaderFocusChange"));
|
|
106
|
+
export.put(ScreenReaderDescendantFocusChangedEvent.EVENT_NAME, EventHelper.buildDirectEventMap("onScreenReaderDescendantFocusChanged"));
|
|
80
107
|
|
|
81
108
|
return export;
|
|
82
109
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
package com.a11yorder;
|
|
2
|
+
|
|
3
|
+
import android.view.ViewGroup;
|
|
4
|
+
|
|
5
|
+
import com.facebook.react.viewmanagers.A11yCardViewManagerInterface;
|
|
6
|
+
import com.facebook.react.views.view.ReactViewManager;
|
|
7
|
+
|
|
8
|
+
public abstract class A11yCardViewManagerSpec<T extends ViewGroup> extends ReactViewManager implements A11yCardViewManagerInterface<T> {
|
|
9
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package com.a11yorder;
|
|
2
2
|
|
|
3
3
|
import com.a11yorder.views.A11yIndexView.A11yIndexView;
|
|
4
|
+
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
4
5
|
import com.facebook.react.views.view.ReactViewManager;
|
|
5
6
|
|
|
6
7
|
public abstract class A11yIndexViewManagerSpec<T extends A11yIndexView> extends ReactViewManager {
|
|
@@ -11,4 +12,12 @@ public abstract class A11yIndexViewManagerSpec<T extends A11yIndexView> extends
|
|
|
11
12
|
public abstract void setOrderFocusType(T viewGroup, int value);
|
|
12
13
|
|
|
13
14
|
public abstract void focus(T view);
|
|
15
|
+
|
|
16
|
+
public abstract void setAutoFocus(A11yIndexView view, boolean value);
|
|
17
|
+
public abstract void setDescendantFocusChangedEnabled(A11yIndexView view, boolean value);
|
|
18
|
+
|
|
19
|
+
public abstract void setContainerType(A11yIndexView view, int value);
|
|
20
|
+
|
|
21
|
+
public abstract void setShouldGroupAccessibilityChildren(A11yIndexView view, int value);
|
|
22
|
+
|
|
14
23
|
}
|
|
@@ -32,8 +32,8 @@ using namespace facebook::react;
|
|
|
32
32
|
|
|
33
33
|
+ (void)onA11yViewFocusChange:(BOOL)isFocused withEmitter:(facebook::react::SharedViewEventEmitter) _eventEmitter {
|
|
34
34
|
if (_eventEmitter) {
|
|
35
|
-
auto viewEventEmitter = std::static_pointer_cast<
|
|
36
|
-
facebook::react::
|
|
35
|
+
auto viewEventEmitter = std::static_pointer_cast<A11yIndexViewEventEmitter const>(_eventEmitter);
|
|
36
|
+
facebook::react::A11yIndexViewEventEmitter::OnScreenReaderFocusChange data = {
|
|
37
37
|
.isFocused = isFocused,
|
|
38
38
|
};
|
|
39
39
|
viewEventEmitter->onScreenReaderFocusChange(data);
|
|
@@ -42,16 +42,16 @@ using namespace facebook::react;
|
|
|
42
42
|
|
|
43
43
|
+ (void)onA11yViewFocused:(facebook::react::SharedViewEventEmitter) _eventEmitter {
|
|
44
44
|
if (_eventEmitter) {
|
|
45
|
-
auto viewEventEmitter = std::static_pointer_cast<
|
|
45
|
+
auto viewEventEmitter = std::static_pointer_cast<A11yIndexViewEventEmitter const>(_eventEmitter);
|
|
46
46
|
viewEventEmitter->onScreenReaderFocused({});
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
+ (void)onA11yViewScreenReaderDescendantFocusChanged:(NSString*)status withId:(NSString*)nativeId withEmitter:(facebook::react::SharedViewEventEmitter) _eventEmitter {
|
|
51
51
|
if (_eventEmitter) {
|
|
52
|
-
auto viewEventEmitter = std::static_pointer_cast<
|
|
52
|
+
auto viewEventEmitter = std::static_pointer_cast<A11yIndexViewEventEmitter const>(_eventEmitter);
|
|
53
53
|
NSString* resultID = nativeId == nil ? @"" :nativeId;
|
|
54
|
-
facebook::react::
|
|
54
|
+
facebook::react::A11yIndexViewEventEmitter::OnScreenReaderDescendantFocusChanged data = {
|
|
55
55
|
.status = [status UTF8String],
|
|
56
56
|
.nativeId = [resultID UTF8String],
|
|
57
57
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RNAOA11yCardView.h
|
|
3
|
+
// react-native-a11y-order
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
#ifndef RNAOA11yCardView_h
|
|
7
|
+
#define RNAOA11yCardView_h
|
|
8
|
+
|
|
9
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
|
+
|
|
11
|
+
#import <React/RCTViewComponentView.h>
|
|
12
|
+
|
|
13
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
14
|
+
|
|
15
|
+
@interface RNAOA11yCardView : RCTViewComponentView
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
NS_ASSUME_NONNULL_END
|
|
19
|
+
|
|
20
|
+
#else
|
|
21
|
+
|
|
22
|
+
#import <React/RCTView.h>
|
|
23
|
+
|
|
24
|
+
@interface RNAOA11yCardView : RCTView
|
|
25
|
+
@end
|
|
26
|
+
|
|
27
|
+
#endif
|
|
28
|
+
|
|
29
|
+
#endif /* RNAOA11yCardView_h */
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RNAOA11yCardView.mm
|
|
3
|
+
// react-native-a11y-order
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
#import "RNAOA11yCardView.h"
|
|
7
|
+
|
|
8
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
9
|
+
|
|
10
|
+
#import <react/renderer/components/RNA11yOrderSpec/ComponentDescriptors.h>
|
|
11
|
+
#import <react/renderer/components/RNA11yOrderSpec/RCTComponentViewHelpers.h>
|
|
12
|
+
#import "RCTFabricComponentsPlugins.h"
|
|
13
|
+
|
|
14
|
+
using namespace facebook::react;
|
|
15
|
+
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
@implementation RNAOA11yCardView {
|
|
19
|
+
UIFocusGuide *_contentFocusGuide;
|
|
20
|
+
NSString *_overlayFocusGroupIdentifier;
|
|
21
|
+
NSString *_contentFocusGroupIdentifier;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
- (nullable NSArray *)accessibilityElements {
|
|
25
|
+
return self.subviews;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
- (void)willRemoveSubview:(UIView *)subview {
|
|
29
|
+
[super willRemoveSubview:subview];
|
|
30
|
+
if (@available(iOS 15.0, *)) {
|
|
31
|
+
NSString *identifier = subview.focusGroupIdentifier;
|
|
32
|
+
if ([identifier isEqualToString:_overlayFocusGroupIdentifier] ||
|
|
33
|
+
[identifier isEqualToString:_contentFocusGroupIdentifier]) {
|
|
34
|
+
subview.focusGroupIdentifier = nil;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
- (void)assignFocusGroupIdentifierToChild:(UIView *)child atIndex:(NSInteger)index {
|
|
40
|
+
if (@available(iOS 15.0, *)) {
|
|
41
|
+
if (!_overlayFocusGroupIdentifier) {
|
|
42
|
+
_overlayFocusGroupIdentifier =
|
|
43
|
+
[NSString stringWithFormat:@"RNAOA11yCard-%p-overlay", self];
|
|
44
|
+
_contentFocusGroupIdentifier =
|
|
45
|
+
[NSString stringWithFormat:@"RNAOA11yCard-%p-content", self];
|
|
46
|
+
}
|
|
47
|
+
if (index == 0) {
|
|
48
|
+
child.focusGroupIdentifier = _overlayFocusGroupIdentifier;
|
|
49
|
+
} else if (index == 1) {
|
|
50
|
+
child.focusGroupIdentifier = _contentFocusGroupIdentifier;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
56
|
+
|
|
57
|
+
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView
|
|
58
|
+
index:(NSInteger)index {
|
|
59
|
+
[super mountChildComponentView:childComponentView index:index];
|
|
60
|
+
[self assignFocusGroupIdentifierToChild:childComponentView atIndex:index];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider {
|
|
64
|
+
return concreteComponentDescriptorProvider<A11yCardViewComponentDescriptor>();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
Class<RCTComponentViewProtocol> A11yCardViewCls(void) {
|
|
68
|
+
return RNAOA11yCardView.class;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
#else
|
|
72
|
+
|
|
73
|
+
- (void)didAddSubview:(UIView *)subview {
|
|
74
|
+
[super didAddSubview:subview];
|
|
75
|
+
NSUInteger index = [self.subviews indexOfObject:subview];
|
|
76
|
+
if (index != NSNotFound) {
|
|
77
|
+
[self assignFocusGroupIdentifierToChild:subview atIndex:(NSInteger)index];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
#endif
|
|
82
|
+
|
|
83
|
+
@end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RNAOA11yCardViewManager.h
|
|
3
|
+
// react-native-a11y-order
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
#ifndef RNAOA11yCardViewManager_h
|
|
7
|
+
#define RNAOA11yCardViewManager_h
|
|
8
|
+
|
|
9
|
+
#import <React/RCTViewManager.h>
|
|
10
|
+
|
|
11
|
+
@interface RNAOA11yCardViewManager : RCTViewManager
|
|
12
|
+
@end
|
|
13
|
+
|
|
14
|
+
#endif /* RNAOA11yCardViewManager_h */
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RNAOA11yCardViewManager.mm
|
|
3
|
+
// react-native-a11y-order
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
#import "RNAOA11yCardView.h"
|
|
7
|
+
#import "RNAOA11yCardViewManager.h"
|
|
8
|
+
|
|
9
|
+
@implementation RNAOA11yCardViewManager
|
|
10
|
+
|
|
11
|
+
RCT_EXPORT_MODULE(A11yCardView)
|
|
12
|
+
|
|
13
|
+
- (UIView *)view {
|
|
14
|
+
return [[RNAOA11yCardView alloc] init];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@end
|
|
@@ -1,48 +1,9 @@
|
|
|
1
|
-
//
|
|
2
|
-
// RNAOA11yIndexView.h
|
|
3
|
-
// A11yOrder
|
|
4
|
-
//
|
|
5
|
-
// Created by Artur Kalach on 13/07/2024.
|
|
6
|
-
// Copyright © 2024 Facebook. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
1
|
#ifndef RNAOA11yIndexView_h
|
|
10
2
|
#define RNAOA11yIndexView_h
|
|
11
3
|
|
|
12
|
-
#import
|
|
13
|
-
#import <React/RCTUITextField.h>
|
|
14
|
-
#import "RNAOScreenReaderFocusDelegate.h"
|
|
15
|
-
#import "RNAOViewItemProtocol.h"
|
|
16
|
-
|
|
17
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
18
|
-
#import <React/RCTViewComponentView.h>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
22
|
-
|
|
23
|
-
@interface RNAOA11yIndexView : RCTViewComponentView<RNAOScreenReaderFocusDelegate, RNAOViewItemProtocol>
|
|
24
|
-
|
|
25
|
-
- (void)setPosition: (NSNumber*)position;
|
|
26
|
-
- (void)setOrderKey:(NSString *)orderKey;
|
|
27
|
-
- (void)setOrderFocusType:(NSNumber *)orderFocusType;
|
|
28
|
-
|
|
29
|
-
@end
|
|
30
|
-
|
|
31
|
-
NS_ASSUME_NONNULL_END
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
#else /* RCT_NEW_ARCH_ENABLED */
|
|
4
|
+
#import "RNAOA11yViewOrder.h"
|
|
35
5
|
|
|
36
|
-
|
|
37
|
-
#import <React/RCTView.h>
|
|
38
|
-
@interface RNAOA11yIndexView : RCTView<RNAOScreenReaderFocusDelegate, RNAOViewItemProtocol>
|
|
39
|
-
|
|
40
|
-
- (void)setPosition: (NSNumber*)position;
|
|
41
|
-
- (void)setOrderKey:(NSString *)orderKey;
|
|
42
|
-
- (void)setOrderFocusType:(NSNumber *)orderFocusType;
|
|
43
|
-
@property (nonatomic, copy) RCTDirectEventBlock onScreenReaderFocusChange;
|
|
6
|
+
@interface RNAOA11yIndexView : RNAOA11yViewOrder
|
|
44
7
|
@end
|
|
45
8
|
|
|
46
|
-
|
|
47
|
-
#endif /* RCT_NEW_ARCH_ENABLED */
|
|
48
9
|
#endif /* RNAOA11yIndexView_h */
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
//
|
|
2
|
-
// RNAOA11yIndexView.m
|
|
3
|
-
// A11yOrder
|
|
4
|
-
//
|
|
5
|
-
// Created by Artur Kalach on 13/07/2024.
|
|
6
|
-
// Copyright © 2024 Facebook. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import <Foundation/Foundation.h>
|
|
10
|
-
|
|
11
1
|
#import "RNAOA11yIndexView.h"
|
|
12
|
-
#import <UIKit/UIKit.h>
|
|
13
|
-
#import <React/RCTViewManager.h>
|
|
14
|
-
#import "RNAOA11yOrderLinking.h"
|
|
15
|
-
#import "RNAOA11yItemDelegate.h"
|
|
16
|
-
#import "UIView+RNAOA11yOrder.h"
|
|
17
|
-
#import "RNAOFabricEventHelper.h"
|
|
18
2
|
|
|
19
3
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
20
4
|
|
|
@@ -23,154 +7,70 @@
|
|
|
23
7
|
#import <react/renderer/components/RNA11yOrderSpec/EventEmitters.h>
|
|
24
8
|
#import <react/renderer/components/RNA11yOrderSpec/Props.h>
|
|
25
9
|
#import <react/renderer/components/RNA11yOrderSpec/RCTComponentViewHelpers.h>
|
|
26
|
-
|
|
27
10
|
#import "RCTFabricComponentsPlugins.h"
|
|
28
11
|
|
|
29
12
|
using namespace facebook::react;
|
|
30
13
|
|
|
31
14
|
@interface RNAOA11yIndexView () <RCTA11yIndexViewViewProtocol>
|
|
32
|
-
|
|
33
15
|
@end
|
|
34
16
|
|
|
35
17
|
#endif
|
|
36
18
|
|
|
37
|
-
@implementation RNAOA11yIndexView
|
|
38
|
-
RNAOA11yItemDelegate* _a11yItemDelegate;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
- (void)didAddSubview:(UIView *)subview {
|
|
42
|
-
[super didAddSubview:subview];
|
|
43
|
-
[_a11yItemDelegate didAddSubview:subview];
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
#ifndef RCT_NEW_ARCH_ENABLED
|
|
47
|
-
- (void)layoutSubviews {
|
|
48
|
-
[super layoutSubviews];
|
|
49
|
-
[_a11yItemDelegate finalizeUpdates];
|
|
50
|
-
}
|
|
51
|
-
#endif
|
|
52
|
-
|
|
53
|
-
- (void)willRemoveSubview:(UIView *)subview {
|
|
54
|
-
[super willRemoveSubview:subview];
|
|
55
|
-
[_a11yItemDelegate willRemoveSubview: subview];
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
- (void)setPosition: (NSNumber*)position {
|
|
59
|
-
[_a11yItemDelegate setPosition: position];
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
- (void)setOrderKey:(NSString *)orderKey {
|
|
63
|
-
[_a11yItemDelegate setOrderKey:orderKey];
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
- (void)setOrderFocusType:(NSNumber *)orderFocusType {
|
|
67
|
-
[_a11yItemDelegate setOrderFocusType: orderFocusType];
|
|
68
|
-
}
|
|
19
|
+
@implementation RNAOA11yIndexView
|
|
69
20
|
|
|
70
21
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
71
|
-
|
|
72
|
-
{
|
|
22
|
+
|
|
23
|
+
- (instancetype)initWithFrame:(CGRect)frame {
|
|
73
24
|
if (self = [super initWithFrame:frame]) {
|
|
74
25
|
static const auto defaultProps = std::make_shared<const A11yIndexViewProps>();
|
|
75
26
|
_props = defaultProps;
|
|
76
|
-
_a11yItemDelegate = [[RNAOA11yItemDelegate alloc] initWithView: self];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return self;
|
|
80
|
-
}
|
|
81
|
-
#else
|
|
82
|
-
- (instancetype)initWithFrame:(CGRect)frame
|
|
83
|
-
{
|
|
84
|
-
if (self = [super initWithFrame:frame]) {
|
|
85
|
-
_a11yItemDelegate = [[RNAOA11yItemDelegate alloc] initWithView: self];
|
|
86
27
|
}
|
|
87
|
-
|
|
88
28
|
return self;
|
|
89
29
|
}
|
|
90
|
-
#endif
|
|
91
30
|
|
|
92
|
-
|
|
93
|
-
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
94
|
-
{
|
|
31
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider {
|
|
95
32
|
return concreteComponentDescriptorProvider<A11yIndexViewComponentDescriptor>();
|
|
96
33
|
}
|
|
97
34
|
|
|
98
|
-
|
|
99
|
-
- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
|
|
100
|
-
{
|
|
35
|
+
- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps {
|
|
101
36
|
const auto &oldViewProps = *std::static_pointer_cast<A11yIndexViewProps const>(_props);
|
|
102
37
|
const auto &newViewProps = *std::static_pointer_cast<A11yIndexViewProps const>(props);
|
|
103
|
-
[super updateProps
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
BOOL isIndexChanged = oldViewProps.orderIndex != newViewProps.orderIndex || _a11yItemDelegate.position == nil;
|
|
107
|
-
if(isIndexChanged) {
|
|
38
|
+
[super updateProps:props oldProps:oldProps];
|
|
39
|
+
|
|
40
|
+
if (oldViewProps.orderIndex != newViewProps.orderIndex || [self delegatePosition] == nil) {
|
|
108
41
|
[self setPosition: @(newViewProps.orderIndex)];
|
|
109
42
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if(isOrderChanged) {
|
|
43
|
+
|
|
44
|
+
if (oldViewProps.orderKey != newViewProps.orderKey || [self delegateOrderKey] == nil) {
|
|
113
45
|
[self setOrderKey: [NSString stringWithUTF8String:newViewProps.orderKey.c_str()]];
|
|
114
46
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
if(isOrderFocusTypeChanged) {
|
|
47
|
+
|
|
48
|
+
if (oldViewProps.orderFocusType != newViewProps.orderFocusType || [self delegateOrderFocusType] == nil) {
|
|
118
49
|
[self setOrderFocusType: @(newViewProps.orderFocusType)];
|
|
119
50
|
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
- (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask {
|
|
123
|
-
[super finalizeUpdates:updateMask];
|
|
124
|
-
[_a11yItemDelegate finalizeUpdates];
|
|
125
|
-
}
|
|
126
51
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
- (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args {
|
|
132
|
-
NSString *FOCUS = @"focus";
|
|
133
|
-
if([commandName isEqual:FOCUS]) {
|
|
134
|
-
[self focusView];
|
|
52
|
+
if (self.autoFocus != newViewProps.autoFocus) {
|
|
53
|
+
[self setAutoFocus: newViewProps.autoFocus];
|
|
135
54
|
}
|
|
136
|
-
}
|
|
137
55
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
56
|
+
if (self.groupChildrenMode != newViewProps.shouldGroupAccessibilityChildren) {
|
|
57
|
+
self.groupChildrenMode = newViewProps.shouldGroupAccessibilityChildren;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (self.descendantFocusChangedEnabled != newViewProps.descendantFocusChangedEnabled) {
|
|
61
|
+
[self setDescendantFocusChangedEnabled: newViewProps.descendantFocusChangedEnabled];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (oldViewProps.containerType != newViewProps.containerType) {
|
|
65
|
+
NSInteger containerType = newViewProps.containerType;
|
|
66
|
+
self.accessibilityContainerType = (UIAccessibilityContainerType)containerType;
|
|
67
|
+
}
|
|
142
68
|
}
|
|
143
69
|
|
|
144
|
-
Class<RCTComponentViewProtocol> A11yIndexViewCls(void)
|
|
145
|
-
{
|
|
70
|
+
Class<RCTComponentViewProtocol> A11yIndexViewCls(void) {
|
|
146
71
|
return RNAOA11yIndexView.class;
|
|
147
72
|
}
|
|
148
73
|
|
|
149
74
|
#endif
|
|
150
75
|
|
|
151
|
-
|
|
152
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
153
|
-
- (void)onScreenReaderFocusChangeHandler:(BOOL)isFocused {
|
|
154
|
-
[RNAOFabricEventHelper onIndexViewFocusChange:isFocused withEmitter:_eventEmitter];
|
|
155
|
-
}
|
|
156
|
-
#else
|
|
157
|
-
- (void)onScreenReaderFocusChangeHandler:(BOOL)isFocused {
|
|
158
|
-
if (self.onScreenReaderFocusChange) {
|
|
159
|
-
self.onScreenReaderFocusChange(@{@"isFocused" : @(isFocused)});
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
#endif
|
|
163
|
-
|
|
164
|
-
- (void)onFocusItemLinked: (UIView*)view {
|
|
165
|
-
[view setScreenReaderFocusDelegate: self];
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
- (void)onFocusItemRemoved: (UIView*)view {
|
|
169
|
-
[view clearScreenReaderFocusDelegate];
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
- (void)onScreenReaderFocusChanged:(BOOL)focused {
|
|
173
|
-
[self onScreenReaderFocusChangeHandler: focused];
|
|
174
|
-
}
|
|
175
|
-
|
|
176
76
|
@end
|
|
@@ -49,6 +49,27 @@ RCT_EXPORT_METHOD(focus:(nonnull NSNumber *)reactTag)
|
|
|
49
49
|
}];
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
RCT_CUSTOM_VIEW_PROPERTY(autoFocus, BOOL, RNAOA11yIndexView)
|
|
53
|
+
{
|
|
54
|
+
BOOL value = json ? [RCTConvert BOOL:json] : NO;
|
|
55
|
+
[view setAutoFocus: value];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
RCT_CUSTOM_VIEW_PROPERTY(descendantFocusChangedEnabled, BOOL, RNAOA11yIndexView)
|
|
59
|
+
{
|
|
60
|
+
BOOL value = json ? [RCTConvert BOOL:json] : NO;
|
|
61
|
+
[view setDescendantFocusChangedEnabled: value];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
RCT_CUSTOM_VIEW_PROPERTY(containerType, NSInteger, UIView)
|
|
65
|
+
{
|
|
66
|
+
NSInteger viewContainerType = json ? [RCTConvert NSInteger:json] : 0;
|
|
67
|
+
view.accessibilityContainerType = (UIAccessibilityContainerType)viewContainerType;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
RCT_EXPORT_VIEW_PROPERTY(onScreenReaderFocused, RCTDirectEventBlock)
|
|
52
71
|
RCT_EXPORT_VIEW_PROPERTY(onScreenReaderFocusChange, RCTDirectEventBlock)
|
|
72
|
+
RCT_EXPORT_VIEW_PROPERTY(onScreenReaderDescendantFocusChanged, RCTDirectEventBlock)
|
|
73
|
+
|
|
53
74
|
|
|
54
75
|
@end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#ifndef RNAOA11yAutoFocusView_h
|
|
2
|
+
#define RNAOA11yAutoFocusView_h
|
|
3
|
+
|
|
4
|
+
#import "RNAOA11yGroupChildrenView.h"
|
|
5
|
+
#import "RNAOA11yFocusService.h"
|
|
6
|
+
|
|
7
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
8
|
+
|
|
9
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
10
|
+
|
|
11
|
+
@interface RNAOA11yAutoFocusView : RNAOA11yGroupChildrenView<RNAOA11yFocusServiceSubscriber>
|
|
12
|
+
@property BOOL autoFocus;
|
|
13
|
+
@property BOOL descendantFocusChangedEnabled;
|
|
14
|
+
@end
|
|
15
|
+
|
|
16
|
+
NS_ASSUME_NONNULL_END
|
|
17
|
+
|
|
18
|
+
#else
|
|
19
|
+
|
|
20
|
+
@interface RNAOA11yAutoFocusView : RNAOA11yGroupChildrenView<RNAOA11yFocusServiceSubscriber>
|
|
21
|
+
@property BOOL autoFocus;
|
|
22
|
+
@property BOOL descendantFocusChangedEnabled;
|
|
23
|
+
@property (nonatomic, copy) RCTDirectEventBlock onScreenReaderDescendantFocusChanged;
|
|
24
|
+
@property (nonatomic, copy) RCTDirectEventBlock onScreenReaderFocusChange;
|
|
25
|
+
@property (nonatomic, copy) RCTDirectEventBlock onScreenReaderFocused;
|
|
26
|
+
@end
|
|
27
|
+
|
|
28
|
+
#endif
|
|
29
|
+
|
|
30
|
+
#endif /* RNAOA11yAutoFocusView_h */
|