0

I have an alert dialog box with custom view. I am setting contentDescription in JAVA for some TextView present in custom view.

One of the content is number 239483.

I am setting contentDescription, converting above number to digit in english.

Now, for the first time when dialog box is displayed. It read from top to bottom.

It read the above number as two hundred thousands etc...

Where as when I specially focus later, It is reading as two three nine...which it read my contentDescription.

Now how can I define that it read contentDescription when it has decided to read fro top to bottom.

This is my code that sets the custom dialog view:

 View viewDialog;

            viewDialog = li.inflate(R.layout.dialog2, null);


        builder.setView(viewDialog);

I also tried with this:

viewDialog.setContentDescription("TEST DESCRIP.");

However, it has no impact. Can you please define how I can tell dialog to read contentDescription from top to bottom, instead of reading a dialog box text that is displayed to the user.

codebased
  • 6,945
  • 9
  • 50
  • 84
  • What API level are you targeting? On API 21+ the preferred way to handle this would be a [TtsSpan](https://developer.android.com/reference/android/text/style/TtsSpan.html) that lets the accessibility service know what type of text is being read. This will also work better for Braille support. – alanv Nov 12 '15 at 17:33
  • Targeting to API 14+ – codebased Nov 12 '15 at 23:48

0 Answers0