Question

What's the preferred way to handle long numbers, like a bank account number, that should be read one character at a time? I know users can get TalkBack to read out a number this way, but it would be nice if we could hint that it should do this from the start.

Is it a good idea to set a content description with spaces between the numbers, or will users find this annoying?

Thanks!

Was it helpful?

Solution

I have talked to several screen-reader users and they have all confirmed that we shouldn't go out of our way to do anything out of the ordinary in cases like this. They all say "Don't worry, we can figure it out. You don't need to help us."

If a screen reader user gets to an area that they need more clarity on they will use their arrow keys to go character by character until they are satisfied and continue on letting the screen-reader continue.

OTHER TIPS

Use the following delegate for your editText or textView

@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {

        switch (host.getId()) {
            case R.id.tv_bookingID:
                if (((TextView) host).getText().length() > 1) {
                    sb.delete(0, sb.length());
                    for (char c : ((TextView) host).getText().toString().toCharArray()) {
                        sb.append(c).append(" ");
                    }
                    //change text for talkback
                    info.setText(null);
                    info.setContentDescription(sb.toString().trim());

                }
                break;
        }
    }//if
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top