1 year ago

#360664

test-img

owenlejeune

Scrolling Android ScrollView with Nested WebView and Native Components with TalkBack

Currently in my app, I have a screen with a ScrollView that contains a header made of native components and a WebView. The whole page needs to be scrollable (ie. the header cannot be fixed above the WebView) so the WebView's height is set with wrap_content. This is not an issue when interacting with the application normally, however, with TalkBack, the page does scroll when swiping through text in the WebView. Focus simply falls off screen. We also have a limiting factor that javascript cannot be enable on the WebView for security reasons. Here is the XML for this screen (some id names and text obfuscated)

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center_vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">
            <FrameLayout
                android:id="@+id/info"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="20dp"
                android:layout_marginEnd="20dp"
                android:layout_marginTop="32dp"
                android:background="@drawable/text_bg_pale_blue"
                android:padding="20dp">

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <ImageView
                        android:id="@+id/icon"
                        android:layout_width="24dp"
                        android:layout_height="24dp"
                        android:layout_alignParentStart="true"
                        android:layout_alignParentTop="true"
                        android:layout_marginTop="8dp"
                        android:layout_marginEnd="8dp"
                        android:src="@mipmap/info" />

                    <TextView
                        android:id="@+id/infoText"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerVertical="true"
                        android:layout_marginTop="8dp"
                        android:layout_toEndOf="@id/icon"
                        android:textSize="16sp"
                        android:textDirection="locale"
                        android:textColor="@color/darkSlate"
                        android:textStyle="bold"
                        android:text="@string/info_text" />

                </RelativeLayout>

            </FrameLayout>

            <WebView
                android:id="@+id/infoWebView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="12dp"
                />

        </LinearLayout>
    </ScrollView>
</RelativeLayout>

Is there anyway to ensure the whole screen can be scrolled with TalkBack enabled while keeping the layout of the page as required?

android

webview

accessibility

talkback

0 Answers

Your Answer

Accepted video resources