WebView prevents accessibility focus from moving forward on TalkBack

2,468 views
Skip to first unread message

Renato Iwashima

unread,
May 25, 2016, 6:39:44 PM5/25/16
to Eyes-free Programming and development
Hi,

I have a simple activity which consists of a WebView and 3 buttons at the bottom.

With TalkBack on, there are some unexpected things that happen:

1. Accessibility focus is placed on the WebView when the activity starts. My expectation is that the focus should start at the "navigate up" button instead (using ActionBar theme).
2. Once the accessibility focus is on the WebView, I can't move the focus past the WebView. This means that the buttons that I have below the WebView are not reachable. It's worth noting that this only happens if the WebView has loaded any data (any HTML content). I can only access these buttons if I navigate backwards or if I explore by touch at the exact location of the buttons at the bottom.

Is this a known issue? Any workarounds?

Sample code below:

Web activity layout file:

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

   
<WebView
        android:id="@+id/web_webview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"></WebView>

   
<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/colorWhite"
        android:orientation="horizontal">

       
<Button
            android:id="@+id/web_like_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Like"/>
   
       
<Button
            android:id="@+id/web_comment_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Comment"/>
   
       
<Button
            android:id="@+id/web_share_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Share"/>
   
</LinearLayout>
</LinearLayout>

WebView activity:

WebView webView;

@Override
protected void onCreate(Bundle savedInstanceState) {
   
super.onCreate(savedInstanceState);
    setContentView
(R.layout.activity_web);

   
webView = (WebView) findViewById(R.id.web_webview);

   
String htmlContent = "<html><head><title>Title of the page</title></head><body><h1>Heading of some awesome article</h1><p>Some awesome paragraph to display.</p></body></html>";
   
webView.loadData(htmlContent, "text/html", "utf-8");
}



Shmuel Naaman

unread,
May 26, 2016, 7:06:26 AM5/26/16
to eyes-f...@googlegroups.com
Hello please provide some information about what versions of the android Opry to system you're using and what version of talk back thanks

Shmuel Naaman
philosoft Mobile 
--
You received this message because you are subscribed to the Google Groups "Eyes-free Programming and development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eyes-free-de...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Renato Iwashima

unread,
May 26, 2016, 1:17:38 PM5/26/16
to Eyes-free Programming and development
TalkBack version is 5.0.1.0 on Android N, but I believe it might also happen on previous versions.

Russell James

unread,
May 28, 2016, 5:15:06 AM5/28/16
to eyes-f...@googlegroups.com, rena...@gmail.com
Forwarding your message to the Eyes Free Developers group

Victor Tsaran

unread,
Jun 1, 2016, 1:44:37 PM6/1/16
to Eyes-free Programming and development, rena...@gmail.com
Hi.
Can you please test with the earlier version of Talkback? Since you are testing with an unreleased version, it is difficult to answer your questions since we cannot be sure that you are using the latest build.

Renato Iwashima

unread,
Jun 1, 2016, 2:08:05 PM6/1/16
to Victor Tsaran, Eyes-free Programming and development
Hi Victor,

I just tested on TalkBack 4.5.0.1 on Android 6.0.1 and I have the same issue.

Renato Iwashima

unread,
Jun 1, 2016, 2:11:02 PM6/1/16
to Victor Tsaran, Eyes-free Programming and development
Just one minor difference is that on TalkBack 4.5, the accessibility focus does not get automatically placed on the WebView once the activity starts, which is the expected behavior.

Victor Tsaran

unread,
Jun 1, 2016, 2:18:38 PM6/1/16
to Renato Iwashima, Eyes-free Programming and development
Hi.
Looks like there may have been a regression on this in TalkBack 4.5. Can you please test with 4.4 and earlier just to be sure?
We will slate the fix for one of the future versions.

Thanks for spotting this.
Victor

Renato Iwashima

unread,
Jun 1, 2016, 2:27:59 PM6/1/16
to Victor Tsaran, Eyes-free Programming and development
Hi Victor,

I tested it on TalkBack 4.4 and everything works as expected.

Victor Tsaran

unread,
Jun 1, 2016, 5:12:45 PM6/1/16
to Renato Iwashima, Eyes-free Programming and development
Thanks for confirming.
Reply all
Reply to author
Forward
0 new messages