10

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!

twaddington
  • 11,607
  • 5
  • 35
  • 46
  • 1
    I think this should be posted under UX Stack Exchange as they can more relate to this question and have more inputs. – deubaka Jun 19 '13 at 02:07
  • 1
    @deubaka I'm happy to post elsewhere if it doesn't seem appropriate, realizes it straddles topics a bit. Primarily wondering if there's some kind of technical way to accomplish this, perhaps by setting an attribute on a `TextView`. – twaddington Jun 19 '13 at 05:15
  • 1
    My suggestion would be to separate the account number into its "logical" divisions (ex. 01129983). In this case, it will be standard and formatted well (might as well make use of a Monospace Typeface for this). Using `android:contentDescription` seems to be the standard way, but I would go on using a 3rd-party Text-To-Voice libraries (ex. http://eyes-free.googlecode.com/svn/trunk/documentation/tutorial/tutorial.html]) as this would eliminate the need to depend on TalkBack's availability. – deubaka Jun 19 '13 at 05:31
  • TalkBack has a feature that allows users to review text by character, so this isn't absolutely necessary. However, adding spaces at logical divisions could work. One warning though: TTS may try to read "129 983" as "one hundred twenty nine, nine hundred eighty-three." – alanv Dec 19 '13 at 23:00

2 Answers2

2

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.

haltersweb
  • 3,001
  • 2
  • 13
  • 14
0

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
}
chzahid
  • 149
  • 2
  • 4