Mobile Developer & Design meetup Bay Area Android Developer meetup April 1,2015 San Francisco, CA Suyash Joshi -‐ @suyashcjoshi Enterprise Mobile Developer Meetup Co-‐Organizer
android:id="@+id/add_note_bu_on" android:src="@drawable/add_note" android:contentDescripGon="@string/add_note" /> <ImageView android:contentDescripGon="Save" /> // In Java (Dynamically) on any Object of type View, implement: public void setContentDescripIon (CharSequence contentDescripIon)
android:inputType=“number” android:hint="Password" android:layout_height="wrap_content" android:layout_width="wrap_content"> </EditText> • Hint Text is needed • Correct inputType helps the user with the correct keyboard shown
next view to receive focus when the user navigates down. • android:nextFocusLet Defines the next view to receive focus when the user navigates let. • android:nextFocusRight Defines the next view to receive focus when the user navigates right. • android:nextFocusUp Defines the next view to receive focus when the user navigates up.
clicks 2. Implement accessibility API methods 3. Send AccessibilityEvent objects specific to your custom view 4. Populate AccessibilityEvent and AccessibilityNodeInfo for your view
//A touch event listener a_ached to an element to perform an acIon on ACTION_UP @Override public boolean onTouchEvent(MoIonEvent event) { int acIon = event.getAcIon(); if(acIon == MoIonEvent.ACTION_UP) // trigger touch on ACTION_UP { ... } return false; }
disInct clickable regions, such as a custom calendar view, you must implement a virtual view hierarchy by overriding getAccessibilityNodeProvider() in your custom view in order to be compaIble with accessibility services.
for managing a virtual view hierarchy rooted at this View and reported to AccessibilityServices that explore the window content • If this method returns an instance, this instance is responsible for managing AccessibilityNodeInfos describing the virtual sub-‐tree rooted at this View including the one represenGng the View itself.
bar that allows a user to select a numeric value by pressing the let or right arrows @Override public boolean onKeyUp (int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT) { mCurrentValue-‐-‐; sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED); return true; } ... } Detailed docs: PopulaIng Accessibility Events
to a physical size of about 9mm. • This is comfortably in the range of recommended target sizes (7-‐10 mm) for touchscreen objects and users will be able to reliably and accurately target them with their fingers.
android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="20sp" /> Read more: h_p://developer.android.com/guide/pracIces/screens_support.html Let raGo be constant, looking at the following 2 equaIons: • dp = px * raIo • sp = px * raIo * scale or sp = dp * scale Scale can be changed by users under device se~ngs
the same color as the background is hard to read. Text with too much contrast can dazzle and also be hard to read. This is especially true of light-‐colored text against dark backgrounds. • Text should maintain a minimum contrast raGo of at least 4.5:1 (calculated based on luminance values) for legibility. • A raGo of 7:1 is preferred. Read more: h_p://www.google.com/design/spec/style/typography.html#typography-‐standard-‐styles
without sighted assistance • All task workflows in the applicaIon can be easily navigated using direcIonal controls and provide clear and appropriate feedback
> TalkBack Verify that user interface controls that provide informaIon (graphics or text) or allow user acIon have clear and accurate audio descripGons when TalkBack is enabled and controls are focused
Explore by Touch: Se~ngs > Accessibility > TalkBack On Android 4.0 and older: Se~ngs > Accessibility > Explore By Touch 1. Verify that user interface controls that provide informaIon (graphics or text) or allow user acIon have clear and accurate audio descripGons when TalkBack is enabled and controls are focused
Accessibility > TalkBack On Android 4.0 and older: Se~ngs > Accessibility > Explore By Touch 1. Use direcIonal controls to move focus between applicaIon layout elements.
D Pad : Use the one provided in the Emulator in lieu of device 1. Verify that app-‐specific gestures, such as zooming images, scrolling lists, swiping between pages or navigaIng carousel controls conInue to work when TalkBack is enabled. 2. If these gestures do not funcIon, then an alternaIve interface for these acIons must be provided.