TextBlock & RichTextBlock as Label for Input.Text #430
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces new support for associating labels with input elements in the Android Adaptive Cards renderer, specifically for
TextInput,TextBlock, andRichTextBlockcomponents. 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
TextInputelements, enabling programmatic label association and retrieval for accessibility purposes. (objectmodel_wrap.cpp,AdaptiveCardObjectModelJNI.java,TextInput.java) [1] [2] [3]TextBlockandRichTextBlockelements, 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
TextInputRendererto set the content description of the input field using the associated label, improving accessibility for screen readers. (TextInputRenderer.java)TextBlockRendererandRichTextBlockRendererto 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
InputUtilsclass 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
AdaptiveCardSchemaKeyenum to includeLabelFor, supporting schema-level identification of label associations. (AdaptiveCardSchemaKey.java)