Skip to content

Conversation

@meethjain
Copy link
Collaborator

This pull request introduces new support for associating labels with input elements in the Android Adaptive Cards renderer, specifically for TextInput, TextBlock, and RichTextBlock components. The changes enable accessibility improvements by allowing labels to be programmatically set and retrieved, and ensure required input indicators are shown in the UI when appropriate. The update also adds utility functions to manage label display logic and required input suffixes.

Label management and accessibility improvements

  • Added new JNI methods and Java bindings to set, get, and check if a label is required for TextInput elements, enabling programmatic label association and retrieval for accessibility purposes. (objectmodel_wrap.cpp, AdaptiveCardObjectModelJNI.java, TextInput.java) [1] [2] [3]
  • Implemented JNI and Java support for retrieving the associated label for TextBlock and RichTextBlock elements, allowing these blocks to act as labels for inputs. (objectmodel_wrap.cpp, AdaptiveCardObjectModelJNI.java, TextBlock.java, RichTextBlock.java) [1] [2] [3] [4] [5] [6]

UI rendering and required input indication

  • Updated TextInputRenderer to set the content description of the input field using the associated label, improving accessibility for screen readers. (TextInputRenderer.java)
  • Modified TextBlockRenderer and RichTextBlockRenderer to append a required input suffix to labels when the associated input is required, using new utility functions. (TextBlockRenderer.java, RichTextBlockRenderer.java, InputUtils.kt) [1] [2] [3]

Utility functions and label display logic

  • Added the InputUtils class to centralize logic for appending required label suffixes and determining whether to display a label for an input, preventing duplicate label rendering when a corresponding label is already present. (InputUtils.kt, CardRendererRegistration.java) [1] [2]

Schema key extension

  • Extended the AdaptiveCardSchemaKey enum to include LabelFor, supporting schema-level identification of label associations. (AdaptiveCardSchemaKey.java)

@P-Harika P-Harika mentioned this pull request Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants