if (busy) {
Util.speak("Screen " + name + " loading");
} else {
Util.speak("Screen " + name);
for (int i = 0; i < childCount; i++) {
final AccessibleContext child =
context.getAccessibleChildAt(i);
readChildElement(child);
}
}
break;
case AccessibleRole.TEXT_FIELD:
if (text != null) {
String currentText = text.getWholeText();
currentText = currentText != null ? currentText.trim() : "";
final String textToSpeak =
currentText.length() > 0 ? " with text " + currentText
: " empty";
toSpeak.append(name + " text field " + textToSpeak);
toSpeak.append(focusedText);
toSpeak.append(editableText);
}
break;
case AccessibleRole.LABEL:
toSpeak.append(name);
toSpeak.append(focusableText);
toSpeak.append(focusedText);
toSpeak.append(selectedText);
toSpeak.append(expandedText);
break;
case AccessibleRole.APP_ICON:
toSpeak.append(name + "application icon");
toSpeak.append(focusedText);
break;
case AccessibleRole.ICON:
toSpeak.append(name + " icon ");
toSpeak.append(focusedText);
break;
case AccessibleRole.DATE:
toSpeak.append(name + " date field ");
toSpeak.append(selectedText);
if (text != null) {
toSpeak.append(" with current value " + text.getWholeText());
}
break;
case AccessibleRole.LIST:
if (busy) {
Util.speak(orientation + "list " + name + " loading");
} else {
Util.speak(orientation + name + "list with " + childCount
+ " elements" + focusedText + multiSelectableText);
for (int i = 0; i < childCount; i++) {
final AccessibleContext child =
context.getAccessibleChildAt(i);
readChildElement(child);
}
}
break;
case AccessibleRole.PANEL:
if (busy) {
Util.speak("panel " + name + " loading");
} else {
Util.speak(name + " panel with " + childCount + " items");
for (int i = 0; i < childCount; i++) {
final AccessibleContext child =
context.getAccessibleChildAt(i);
readChildElement(child);
}
}
break;
case AccessibleRole.GAUGE:
if (busy) {
Util.speak("gauge " + name + " loading");
} else {
Util.speak(name
+ " gauge with value "
+ context.getAccessibleValue()
.getCurrentAccessibleValue());
}
break;
case AccessibleRole.PUSH_BUTTON:
toSpeak.append(name + " button");
toSpeak.append(focusedText);
break;
case AccessibleRole.MENU_ITEM:
toSpeak.append(name + " menu item ");
toSpeak.append(selectedText);
break;
case AccessibleRole.CHECKBOX:
toSpeak.append(name);
toSpeak.append(" check box ");
toSpeak.append(focusedText);
toSpeak.append(checkedText);
break;
case AccessibleRole.TABLE:
if (busy) {
Util.speak("table " + name + " loading");
} else {
final AccessibleTable table = context.getAccessibleTable();
if (table != null) {
readTableElement(context);
if (selectable) {
ScreenReaderHandler.handleTableSelection(table);
}
}
}
break;
case AccessibleRole.BITMAP:
Util.speak(name + " image");
break;
case AccessibleRole.COMBO:
toSpeak.append(name + " combobox ");
toSpeak.append(expandedText);
if (expanded) {
Util.speak(toSpeak.toString());
toSpeak.setLength(0);
for (int i = 0; i < childCount; i++) {
final AccessibleContext child =
context.getAccessibleChildAt(i);
readChildElement(child);
}
} else {
final String value = context.getAccessibleText().getWholeText();
if (value != null && value.length() > 0) {
toSpeak.append(" current value " + value);
} else {
toSpeak.append(" empty");
}
}
break;
case AccessibleRole.HYPERLINK:
toSpeak.append(name + " hyperlink ");
break;
case AccessibleRole.SEPARATOR:
toSpeak.append("separator");
break;
case AccessibleRole.TREE_FIELD:
Util.speak(name + " tree field" + expandableText + collapsedText
+ expandedText + selectedText);
for (int i = 0; i < childCount; i++) {
final AccessibleContext child = context.getAccessibleChildAt(i);
readChildElement(child);
}
break;
case AccessibleRole.CHOICE:
toSpeak.append(name + " choice with " + childCount + " elements");
toSpeak.append(focusedText);
toSpeak.append(expandedText);
if (expanded) {
Util.speak(toSpeak.toString());
toSpeak.setLength(0);
for (int i = 0; i < childCount; i++) {
final AccessibleContext child =
context.getAccessibleChildAt(i);
readChildElement(child);
}
} else {
toSpeak.append(" current value "