Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1/n Adding Android support for Accessibility TtsSpan API - Support for accessibilitySpan and accessibilityLabel props in nested Text #35130

Closed
wants to merge 91 commits into from

Commits on Oct 29, 2022

  1. Configuration menu
    Copy the full SHA
    216a30a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    48a01d0 View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2022

  1. add span description

    Notes
    "The Screenreader stops reading the span text when the focus moves on the AccessibilityLink. The issue may be connected to the latest changes.
    incompatible types: CharSequence cannot be converted to SpannableString
spannableDescription = text.subSequence(start, end);
    The start and end of the AccessibilityLink need to be updated after changing the length of the string. Complete the functionality and fix all the compile errors"	"facebook#35130 (comment)
    https://github.com/fabriziobertoglio1987/react-native/blob/48a01d006a45c49018d8c3860f40b696b1aa7269/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java#L600"
    fabOnReact committed Oct 31, 2022
    Configuration menu
    Copy the full SHA
    08d6f43 View commit details
    Browse the repository at this point in the history
  2. remove code duplication

    fabOnReact committed Oct 31, 2022
    Configuration menu
    Copy the full SHA
    145303e View commit details
    Browse the repository at this point in the history
  3. remove code duplication

    fabOnReact committed Oct 31, 2022
    Configuration menu
    Copy the full SHA
    f66e914 View commit details
    Browse the repository at this point in the history

Commits on Nov 1, 2022

  1. Configuration menu
    Copy the full SHA
    3d4e662 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1653d6b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6def7a9 View commit details
    Browse the repository at this point in the history
  4. Fabric cpp settings trigger runtime error

    terminating with uncaught exception of type std::length_error: vector (screenshot1, screenshot2)
    https://www.icloud.com/iclouddrive/0a4Urx1Av554xzHH1hh3YHy9A#first_screenshot
    https://stackoverflow.com/a/1183709/7295772
    fabOnReact committed Nov 1, 2022
    Configuration menu
    Copy the full SHA
    7fa58f5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    43e7c29 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    0afdc69 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0cd0ac4 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f5a3b49 View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2022

  1. remove log messages

    fabOnReact committed Nov 2, 2022
    Configuration menu
    Copy the full SHA
    08fc9ac View commit details
    Browse the repository at this point in the history
  2. debug - change key number

    fabOnReact committed Nov 2, 2022
    Configuration menu
    Copy the full SHA
    c2adbb8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    46c4fb8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    45ec47f View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2022

  1. Configuration menu
    Copy the full SHA
    0a00193 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    72ee5a1 View commit details
    Browse the repository at this point in the history
  3. accessibilityRole verbatim correctly announces span text, but does no…

    …t focus on on nested text
    fabOnReact committed Nov 3, 2022
    Configuration menu
    Copy the full SHA
    81fe302 View commit details
    Browse the repository at this point in the history
  4. Remove logic for announcing nested text

    announcement of TtsSpan works with Text and nested text, but they are
    not focusable. The functionality will be added as second PR
    fabOnReact committed Nov 3, 2022
    Configuration menu
    Copy the full SHA
    7af9bd3 View commit details
    Browse the repository at this point in the history
  5. clean up not needed logic

    fabOnReact committed Nov 3, 2022
    Configuration menu
    Copy the full SHA
    16f1f39 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d845073 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e215baa View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2022

  1. Configuration menu
    Copy the full SHA
    03a125c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fe5c480 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7e264da View commit details
    Browse the repository at this point in the history
  4. removing not required logic

    - add date TtsSpan
    - remove ids.xml and setTag logic
    - remove changes to AccessibilityLinks
    fabOnReact committed Nov 4, 2022
    Configuration menu
    Copy the full SHA
    d8823e5 View commit details
    Browse the repository at this point in the history
  5. update description

    fabOnReact committed Nov 4, 2022
    Configuration menu
    Copy the full SHA
    9d4b8a5 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7b85e25 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    aefa45f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    95d6d3b View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2022

  1. Configuration menu
    Copy the full SHA
    24c182a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7b4231f View commit details
    Browse the repository at this point in the history

Commits on Nov 10, 2022

  1. Configuration menu
    Copy the full SHA
    4fbc54b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    29a8104 View commit details
    Browse the repository at this point in the history

Commits on Nov 11, 2022

  1. clean up diff

    fabOnReact committed Nov 11, 2022
    Configuration menu
    Copy the full SHA
    e3fd7ff View commit details
    Browse the repository at this point in the history
  2. clean up diff

    fabOnReact committed Nov 11, 2022
    Configuration menu
    Copy the full SHA
    3e1d292 View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2022

  1. Adding prop accessibilityUnit to TextAttributesProps (fabric) (#3)

    ## Summary
    
    Adds the accessibilityUnit to fabric CPP API  (part of PR facebook#35130 Adding support for Android Accessibility TtsSpan API)
    
    The TtsSpan API now supports verbatim, date, and fraction but may not work with other span types like phone numbers, currency, time, measure, and money.
    
    An explanation of the use case is as follows:
    - Time is spelled 1 0 3 0 instead of ten thirty
    - The developer does not have the option to specify if 10m stands for 10 meters or 10 miles, or 10 minutes
    - Phone numbers, for example, 33312344, are not yet supported
    
    Implementing the above functionality requires adding a new prop to the react-native API responsible for managing attributes of nested Text. 
    
    - Java and CPP TextAttributes manage the functionality.
    - Nested Text does not correspond to a Widget on Android but an Android TextView Span.  
    
    The spans are updated based on a caching mechanism that re-renders the Android TextView only if specific attributes are updated.
The updates are triggered only if the Text or Paragraph Text attributes change.
    - An example of Text attributes is accessibilityRole, font-weight, and backgroundColor.
    - An example of Paragraph attributes is textBreakstrategy. They are updated with different mechanisms because they may change the paragraph layout.
    These mappings are configured in Java, CPP, and Javascript.
    
    As this and PR [facebook#33468](facebook#33468) require changes to the text attributes, the below work was needed:
    
    - issue documented in PR [facebook#33468 (comment)](facebook#33468 (comment)) and PR [facebook#35130 (comment)](facebook#35130 (comment)). The CPP changes for facebook#35130 are moved to a separate PR ([fabriziobertoglio1987#2](#2)). The RNTester App would crash without a clear stack trace on startup after making changes to CPP. This was later fixed by adding the CPP headers to the prefab library rrc_view (see this [comment](facebook#35130 (comment))).
    - Adding the CPP configurations (see [fabriziobertoglio1987#2](https://github.com/fabriziobertoglio1987/react-- native/pull/2)) required extensive troubleshooting and analysis
    
    Related: PR #4 - separating accessibilityUnit from accessibilityMinutes and accessibilityHours
    fabOnReact authored Nov 15, 2022
    Configuration menu
    Copy the full SHA
    8b23efd View commit details
    Browse the repository at this point in the history
  2. code-review

    fabOnReact committed Nov 15, 2022
    Configuration menu
    Copy the full SHA
    bea5af9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6fc18d4 View commit details
    Browse the repository at this point in the history

Commits on Nov 16, 2022

  1. The ReactTtsSpan.Builder constructor expects a string and not an Acce…

    …ssibilityRole type in TextLayoutMapManagerBuffer

    
    Review logic in [TextLayoutManagerBuffer](https://github.com/facebook/react-native/pull/35130/files#diff-35ab02390dd5f5dffb2c01d532a959c5bebdc9cbf780fbc35f1767120f2330f9R146-R163):
    The ReactTtsSpan.Builder constructor expects a string and not an AccessibilityRole type in [TextLayoutMapManagerBuffer](https://github.com/fabriziobertoglio1987/react-native/blob/6fc18d45e1df20f39ec07d1527fd42909b8cd82d/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java#L146)
Add a constructor to ReactTtsSpan.Builder that accepts the type AccessibilityRole and converts it to string. Use [getValue()](https://github.com/fabriziobertoglio1987/react-native/blob/6fc18d45e1df20f39ec07d1527fd42909b8cd82d/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java#L152s) to convert. The constructor also accepts the accessibilityUnit parameter and handles those scenarios.
    Fix build errors from the prev configs
    Test TtsSpan TIME
    fabOnReact committed Nov 16, 2022
    Configuration menu
    Copy the full SHA
    8b592f7 View commit details
    Browse the repository at this point in the history
  2. adding type money support

    fabOnReact committed Nov 16, 2022
    Configuration menu
    Copy the full SHA
    f2642f6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c4cd23b View commit details
    Browse the repository at this point in the history

Commits on Nov 17, 2022

  1. improve logging

    fabOnReact committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    576bad6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    958ae95 View commit details
    Browse the repository at this point in the history
  3. adding final to Set

    fabOnReact committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    8a59592 View commit details
    Browse the repository at this point in the history
  4. static interface method invocations are not supported in -source 7

    static interface method invocations are not supported in -source 7
    684
          Set.of(
    685
             ^
    686
      (use -source 8 or higher to enable static interface method invocations)
    
    https://github.com/facebook/react-native/actions/runs/3489954089/jobs/5840743238
    fabOnReact committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    eb95e08 View commit details
    Browse the repository at this point in the history
  5. error: static interface method invocations are not supported in -sour…

    …ce 7
    
    error: static interface method invocations are not supported in -source 7
              Set.of(
                 ^
      (use -source 8 or higher to enable static interface method invocations)
    /root/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTtsSpan.java:62: error: static inter
    fabOnReact committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    5aa9f74 View commit details
    Browse the repository at this point in the history
  6. refactor example

    fabOnReact committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    cb52ad9 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    60ef8f0 View commit details
    Browse the repository at this point in the history
  8. adding support for measure

    fabOnReact committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    06096d5 View commit details
    Browse the repository at this point in the history
  9. simplify ReactTtsSpan API

    fabOnReact committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    cc45e04 View commit details
    Browse the repository at this point in the history
  10. remove time warning

    fabOnReact committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    096019c View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    7f4a0cd View commit details
    Browse the repository at this point in the history
  12. adding comments to prop

    fabOnReact committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    0a42fd0 View commit details
    Browse the repository at this point in the history
  13. remove comment

    fabOnReact committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    79c4aed View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2022

  1. Configuration menu
    Copy the full SHA
    dfc4063 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3b30659 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fe4e1e0 View commit details
    Browse the repository at this point in the history

Commits on Dec 13, 2022

  1. Configuration menu
    Copy the full SHA
    ef9c59b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ac79bae View commit details
    Browse the repository at this point in the history
  3. minor changes

    fabOnReact committed Dec 13, 2022
    Configuration menu
    Copy the full SHA
    145db13 View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2022

  1. fix xcode warning

    fabOnReact committed Dec 14, 2022
    Configuration menu
    Copy the full SHA
    a892b68 View commit details
    Browse the repository at this point in the history

Commits on Jan 12, 2023

  1. Configuration menu
    Copy the full SHA
    61e5920 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f495025 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    753858e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    821a4c8 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4988339 View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2023

  1. Configuration menu
    Copy the full SHA
    02af5a4 View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2023

  1. remove view prop (take 3)

    fabOnReact committed Feb 3, 2023
    Configuration menu
    Copy the full SHA
    dcb9f61 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e7cbd28 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    565d7ed View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a1c7e0f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f797c20 View commit details
    Browse the repository at this point in the history
  6. accSpan enum type

    fabOnReact committed Feb 3, 2023
    Configuration menu
    Copy the full SHA
    8b90011 View commit details
    Browse the repository at this point in the history
  7. fix verbatim not working

    fabOnReact committed Feb 3, 2023
    Configuration menu
    Copy the full SHA
    e830578 View commit details
    Browse the repository at this point in the history
  8. adding cpp AccSpan type

    fabOnReact committed Feb 3, 2023
    Configuration menu
    Copy the full SHA
    25b212e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    c058657 View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2023

  1. Verbatim and other strings are not announced.

    Cpp is misconfigured and passes allways none to java.
    As the issue seems caused by the toString conversion, debug the fromRawValue and toString conversions.
    CPP allways passes “none” for any value.
    
    facebook#35130 (comment)
    fabOnReact committed Feb 6, 2023
    Configuration menu
    Copy the full SHA
    151b37c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6f68513 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e1c56ac View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2023

  1. Configuration menu
    Copy the full SHA
    ecc815b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7c80bdb View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    34ed14e View commit details
    Browse the repository at this point in the history
  4. rename UNIT to LABEL

    fabOnReact committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    23241dd View commit details
    Browse the repository at this point in the history

Commits on Feb 8, 2023

  1. Configuration menu
    Copy the full SHA
    112ed6f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    235eda8 View commit details
    Browse the repository at this point in the history
  3. update comments

    fabOnReact committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    d536cf7 View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2023

  1. update comments

    fabOnReact committed Feb 9, 2023
    Configuration menu
    Copy the full SHA
    c154196 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    76ce49a View commit details
    Browse the repository at this point in the history