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
[TIMOB-24415] Android: Fix a11y properties for ListItems #10399
Conversation
Generated by 🚫 dangerJS |
About "needs tests" label: we can't create unit tests to check this feature. For proper testing we need UI tests (and smth. like appium). Same for #10397. |
Tests:
|
Add "accessibilityHint", "accessibilityLabel" and "accessibilityValue" properties to MenuItem element. Make 'TiUIView.composeContentDescription' static. refs TIMOB-26463
- Remove hardcoded content description. - Add a11y properties to the refresh list. Need to refresh all a11y properties if any of them are changed, because native "contentDescription" property is build as their concatenation. refs TIMOB-24415
var win = Ti.UI.createWindow({backgroundColor: 'white'});
var myTemplate = {
childTemplates: [
{ // Image justified left
type: 'Ti.UI.ImageView', // Use an image view for the image
bindId: 'pic', // Maps to a custom pic property of the item data
properties: { // Sets the image view properties
width: '50dp', height: '50dp', left: 0
}
},
{ // Title
type: 'Ti.UI.Label', // Use a label for the title
bindId: 'info', // Maps to a custom info property of the item data
properties: { // Sets the label properties
color: 'black',
font: { fontFamily:'Arial', fontSize: '20dp', fontWeight:'bold' },
left: '60dp', top: 0,
}
},
{ // Subtitle
type: 'Ti.UI.Label', // Use a label for the subtitle
bindId: 'es_info', // Maps to a custom es_info property of the item data
properties: { // Sets the label properties
color: 'gray',
font: { fontFamily:'Arial', fontSize: '14dp' },
left: '60dp', top: '25dp',
}
}
]
};
var listView = Ti.UI.createListView({
templates: { 'template': myTemplate },
defaultItemTemplate: 'template'
});
var sections = [];
var fruitSection = Ti.UI.createListSection({headerTitle: 'Fruits / Frutas'});
var fruitDataSet = [
{
info: {
text: 'Apple',
accessibilityLabel: 'AppleLabel,'
},
es_info: {
text: 'Manzana',
accessibilityHint: 'Manzanahint;'
},
pic: {image: 'apple.png',
accessibilityValue: 'apple.pngVALUE.'}
},
{
info: {text: 'Banana',
accessibilityLabel: 'BananaLabel,',
accessibilityValue: 'BananaVALUE.'},
es_info: {text: 'Banana',
accessibilityHint: 'Bananahint;',
accessibilityValue: 'BananaVALUE.'},
pic: {image: 'banana.png',
accessibilityLabel: 'banana.pngLabel,',
accessibilityHint: 'banana.pnghint;'}
}
];
fruitSection.setItems(fruitDataSet);
sections.push(fruitSection);
listView.setSections(sections);
win.add(listView);
win.open(); |
Closing in favor of #10978 |
JIRA: https://jira.appcelerator.org/browse/TIMOB-24415
This PR uses same base commit as #10397