final int newValue, final AccessibleContext context) {
switch (event) {
case AccessibleContext.ACCESSIBLE_STATE_CHANGED:
if (Util.hasTransitionedToState(oldValue, newValue,
AccessibleState.FOCUSED)) {
final AccessibleDateField dateField =
(AccessibleDateField) context;
final String dateSubfieldString =
Util.getDateSubfieldString(dateField.getDateFieldType());
Util.speak(dateSubfieldString + " focused");
}
break;
case AccessibleContext.ACCESSIBLE_VALUE_CHANGED:
final AccessibleDateField dateField = (AccessibleDateField) context;
final String dateSubfieldString =
Util.getDateSubfieldString(dateField.getDateFieldType());
Util.speak(dateSubfieldString + " value changed");
Util.speak("New value " + context.getAccessibleName());
break;
}
}