How to m avw a Autocomplete accessibile

3 views
Skip to first unread message

Petra Ritter

unread,
Dec 8, 2019, 8:12:59 AM12/8/19
to Eyes-free Programming and development
Hello,

In a course about accessibility  of native Android apps there is an example how to make an Autocomplete accessible.

Given  is the following code

stings.xml

<string-array name="languages_array">
    <item>Java</item>
    <item>JavaScript</item>
    <item>Objective-C</item>
    <item>C</item>
    <item>C#</item>
    <item>.NET</item>
    <item>C++</item>
    <item>Visual Basic</item>
    <item>Basic</item>
    <item>Swift</item>
    <item>Python</item>
    <item>Assembly</item>
    <item>ActionScript</item>
</string-array>

MainAcctivity.java

...
...
...


 final AutoCompleteTextView autoCompleteTextView = (AutoCompleteTextView) findViewById(R.id.autoCompleteTextView); ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, getResources().getStringArray(R.array.languages_array)); autoCompleteTextView.setThreshold(1); autoCompleteTextView.setAdapter(adapter);




activity-main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/andro
....
...
...
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Programming Language"
android:labelFor="@+id/autoCompleteTextView"
android:textAppearance="@android:style/ TextAppearance.Material.Medium" />

<AutoCompleteTextView
android:id="@+id/autoCompleteTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Swift, JavaScript, etc."
android:layout_below="@+id/textView2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />


According the curse the native AutoCompleteTextView should handle the announcement by TalkBack of the Items as they became visible.
It looks as something is wrong with this demo app, as talkback don't announce the items as they became visible.




How I can solve this problem?

Thanks in Advance for your help.

Best regards


Petra Ritter





Reply all
Reply to author
Forward
0 new messages