E-mail List Archives

Re: Android app accessibility

for

From: Renato Iwashima
Date: Aug 23, 2016 1:40PM


> 1) Is there a way to get Talkback to announce the current field on
launch? Or give simple instructions?

You can use announceForAccessibility() to do this. One note: if you are
moving the focus when the activity starts, I'd recommend to not do it. Let
the default accessibility focus behavior do its job: let the first swipe to
be a focus on the first element following reading order (left to right, top
to bottom).

> 2) The username and password fields do not have visible labels, just
field hints. Since it's a simple login form, perhaps this is not critical
but it would be nice. The developers don't want to add labels. Is there a
way to provide invisible labels in Android? There's a workaround discussed
at http://www.last-child.com/accessible-android-inputs-with-material-design/,
but they note there seems to be a bug in Android below 5.0 where the
workaround does not work, so I can't recommend it.

You could use android:labelFor on a transparent TextView, but it's a hack.
I'd still recommend to use TextInputLayout because the floating label is
persistent.

This example does not cause any problems to me on M or N (make sure hint is
in the text input layout and not in the edit text, make sure you are using
TextInputEditText and not EditText and make sure you are using the latest
version of the support design library):

<android.support.design.widget.TextInputLayout
android:id="@+id/forms_email_text_input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/layout_padding"
android:labelFor="@+id/forms_email_edit_box"
android:accessibilityLiveRegion="polite"
android:hint="@string/edit_text_email_label"
app:errorTextAppearance="@style/ErrorText"
app:errorEnabled="true">

<android.support.design.widget.TextInputEditText
android:id="@+id/forms_email_edit_box"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"/>

</android.support.design.widget.TextInputLayout>

I hope it helps and let me know if you have any problems or questions.


On Tue, Aug 23, 2016 at 10:06 AM, Marc Solomon < <EMAIL REMOVED> >
wrote:

> Here is a link to the accessibility documentation for Android developers:
> https://developer.android.com/guide/topics/ui/accessibility/index.html.
>
> And, here is a free tool to perform an automated accessibility test of an
> Android app: https://play.google.com/store/apps/details?id=com.google.
> android.apps.accessibility.auditor.
>
> HTH,
> Marc
>
> -----Original Message-----
> From: WebAIM-Forum [mailto: <EMAIL REMOVED> ] On
> Behalf Of Joseph Sherman
> Sent: Tuesday, August 23, 2016 12:27 PM
> To: WebAIM Discussion List < <EMAIL REMOVED> >
> Subject: [WebAIM] Android app accessibility
>
> I'm not sure where to ask this question about android app accessibility.
> If not here, can someone point me to a resource?
>
> We have just developed an android app. On launch you are at the apps login
> page, with focus in the username field. Talkback states the app name, but
> nothing else on launch.
>
>
> 1) Is there a way to get Talkback to announce the current field on
> launch? Or give simple instructions?
>
> 2) The username and password fields do not have visible labels, just
> field hints. Since it's a simple login form, perhaps this is not critical
> but it would be nice. The developers don't want to add labels. Is there a
> way to provide invisible labels in Android? There's a workaround discussed
> at http://www.last-child.com/accessible-android-inputs-
> with-material-design/, but they note there seems to be a bug in Android
> below 5.0 where the workaround does not work, so I can't recommend it.
>
>
> Thanks.
> Joseph
>
> > > > > > > > >