Challenge: Providing Enough Context for Data Entry

The date button and CHOOSE SUSPECT button both suffer from a similar problem. Users, whether using TalkBack or not, are not explicitly told what the button with the date on it is for. Similarly, once users select a contact as the suspect, they are no longer told or shown what the button represents. Users can probably infer the meaning of the buttons and the text on those buttons, but should they have to?

This is one of the nuances of UI design. It is up to you (or your design team) to figure out what makes the most sense for your application – to balance simplicity of the UI with ease of use.

For this challenge, update the implementation of the details screen so that users do not lose context about what the data they have chosen means. This could be as simple as adding labels for each field. To do this, you could add a TextView label for each button. Then you would tell TalkBack that the TextView is a label for the Button using the android:labelFor attribute.

    <TextView
        android:id="@+id/crime_date_label"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Date"
        android:labelFor="@+id/crime_date"/>
    <Button
        android:id="@+id/crime_date"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        tools:text="Wed Nov 14 11:56 EST 2018"/>

The android:labelFor attribute tells TalkBack that the TextView serves as a label to the view specified by the ID value. labelFor is defined on the View class, so you can associate any view as the label for any other view. Note that you must use the @+id syntax here because you are referring to an ID that has not been defined at that point in the file. You could now remove the + from the android:id="@+id/crime_title" line in the EditText’s definition, but it is not necessary to do so.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
44.211.239.181