SlideShare a Scribd company logo
1 of 26
Accessibility in Android
Sk. Arman Ali
Software Engineer at
W3Engineers Ltd.
What is Accessibility
• Easier to use by those with disabilities.
WHY?
• Most people will have at least a short term
disability at some time that makes it difficult to
use their mobile device.
• This includes someone who was born blind, or
lost fine motor skills in an accident.
• This also includes someone who can’t use their
hands because they are carrying a wiggly child.
• You may have experienced difficulties using your
phone while wearing gloves when it’s cold
outside.
WHY…
• Maybe you’ve had a hard time distinguishing
items on the screen when it’s bright outside.
• With so much of the population experiencing
decreased vision, hearing, mobility, and
cognitive function, you should do your best to
give everyone the best experience in your
apps that you can.
• It’s a small way you can make people’s lives
better.
How?
Enabling accessibility tools
• There are many tools that people use to
interact with their Android devices. This
includes TalkBack, Magnification, and Switch
Access, to name a few.
Enabling accessibility tools
• TalkBack allows you to explore the view using
gestures, while also audibly describing what’s on the
screen.
• Magnification allows you to zoom in on parts of the
screen.
• Both TalkBack and Magnification are helpful for
people with limited visibility.
• People with limited mobility can use Switch Access to
allow them to navigate without using the touch
screen.
• You can find all the accessibility features in
Settings/Accessibility on your device.
Enabling accessibility tools…
• This session is going to look mainly at TalkBack, as it
incorporates both screen traversal for navigation and
screen reading to understand what is in focus.
• By using TalkBack, a user can use gestures, such as
swiping left to right, on the screen to traverse the
items shown on the screen.
• As each item is in focus, there is an audible
description given.
• This is useful for people with vision impairments that
cannot see the screen well enough to understand
what is there, or select what they need to.
Enabling accessibility tools…
• To turn on TalkBack, go to Settings on your
Android device. Then find Accessibility/TalkBack,
and toggle the tool on.
Accessibility Attributes
Content description
• You can easily improve this user experience by adding
a android:contentDescription.
• Adding a content description is something you should
do for every image or button that does not otherwise
have text for the screen reader to read.
• If the element is not important to understand what is
on the screen, the contentDescription can be set to
@null. If you do this, TalkBack, and other screen
readers will skip the element entirely, and move onto
the next thing in the view.
Accessibility Attributes…
<android.support.design.widget.FloatingActionButton
……….
android:contentDescription=“Add coffee”
……….
/>
Accessibility Attributes…
Grouping
• To specify that both the elements should be in
focus at the same time, add the
android:focusable attribute with the value ”true”
the parent element of the two, the LinearLayout
with the id.
• Also add the attribute
android:focusableInTouchMode with the value
”false”, as you only want this to be focusable for
the screen reader.
Accessibility Attributes…
<LinearLayout
android:id="@+id/consumedContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="false"
android:orientation="horizontal"/>
Accessibility Attributes…
Labels
• The label is read separately from the editable
value, with nothing linking the two.
<TextView android:id="@+id/coffeeLimitLabel"
android:labelFor="@id/coffeeLimitValue"
android:text="@string/coffee_limit_label" />
Accessibility Attributes…
Traversal order
• android:accessibilityTraversalBefore on a
view to specify what item this should come
before.
<android.support.design.widget.FloatingActionButton
android:accessibilityTraversalBefore=“Expected ID"
android:contentDescription=“Add coffee “/>
Accessibility Attributes…
Announce for accessibility
• When announceForAccessibility() is called,
Android will give an audible announcement
for those using a screen reader, and do
nothing if an accessibility tool is not in use.
• You can use this to inform the user that the
value has been changed.
Accessibility Attributes…
Announce for accessibility
addCoffee.setOnClickListener
{
amountConsumed.announceForAccessibility(getString(R.stri
ng.count_updated, consumedString()))
}
Accessibility Attributes…
Designing for accessibility
• Google recommends to make any clickable items
at least 48dp in size. That is because anything
smaller is difficult for people with vision and
motor impairments to tap accurately.
• To solve this, add the android:minHeight
attribute to that EditText. Make sure the value is
at least 48dp. Alternatively, you could set
android:height to 48dp or higher.
Accessibility Attributes…
• Color contrast
Figure 1: Example of low and increased contrast ratios between foreground and
background colors
Accessibility Attributes…
Color contrast
• The recommended contrast ratio for text size is at
least 3.0 to 1.
• Use Accessibility Scanner
Google also gives us an Accessibility Scanner that
you can download from the Play Store. After
downloading, the scanner can be turned on in the
same Accessibility settings menu you were in
before to turn on TalkBack. Navigate to
Settings/Accessibility/Accessibility Scanner, and
toggle it on.
Accessibility Attributes…
• Use cues other than color
Figure 2: Examples of differentiating UI elements using color only and using
color, shapes, and text
DEMO TIME
Build accessible custom views
• If your application requires a custom view
component, you must do some additional work to
ensure that your custom view is accessible. These
are the main tasks for ensuring the accessibility of
your view:
– Handle directional controller clicks
– Implement accessibility API methods
– Send AccessibilityEvent objects specific to your
custom view
– Populate AccessibilityEvent and
AccessibilityNodeInfo for your view
Build accessible custom views
- Handle clicks
- Send AccessibilityEvent objects specific to your custom view
setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// Send an AccessibilityEvent, since the user has interacted with the view.
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
}
});
Build accessible custom views
Populate AccessibilityEvent and AccessibilityNodeInfo for your
view
public void onPopulateAccessibilityEvent(AccessibilityEvent event) {
super.onPopulateAccessibilityEvent(event);
// Detect what type of accessibility event is being passed in.
int eventType = event.getEventType();
if (eventType == AccessibilityEvent.TYPE_VIEW_SELECTED ||
eventType == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED) {
event.getText().add("Mode selected: " + Integer.toString(mActiveSelection + 1) + ".");
event.setItemCount(SELECTION_COUNT);
event.setCurrentItemIndex(mActiveSelection);
}
// When a user first focuses on our view, we'll also read out some simple instructions to
// make it clear that this is an interactive element.
if (eventType == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED) {
event.getText().add("Tap to change.");
}
}
DEMO TIME
THANK YOU ☺

More Related Content

Similar to Accessibility in Android - Enable tools like TalkBack

React Native Accessibility - San Diego React and React Native Meetup
React Native Accessibility - San Diego React and React Native MeetupReact Native Accessibility - San Diego React and React Native Meetup
React Native Accessibility - San Diego React and React Native MeetupTed Drake
 
iOS Human Interface Guidelines (HCI)
iOS Human Interface Guidelines (HCI)iOS Human Interface Guidelines (HCI)
iOS Human Interface Guidelines (HCI)Mohammad Khalil
 
iOS Human Interface Guidlines for iOS-Platforms
iOS Human Interface Guidlines for iOS-PlatformsiOS Human Interface Guidlines for iOS-Platforms
iOS Human Interface Guidlines for iOS-PlatformsMartin Ebner
 
Navigating Inclusivity: Insights from Accessibility Experts
Navigating Inclusivity: Insights from Accessibility ExpertsNavigating Inclusivity: Insights from Accessibility Experts
Navigating Inclusivity: Insights from Accessibility ExpertsRiley Claire
 
Developing accessible android applications
Developing accessible android applicationsDeveloping accessible android applications
Developing accessible android applicationsRenato Iwashima
 
Web accessibility is everyone's job
Web accessibility is everyone's jobWeb accessibility is everyone's job
Web accessibility is everyone's jobRemya Ramesh
 
Best Wearable App Development Services In USA, UK And India.pdf
Best Wearable App Development Services In USA, UK And India.pdfBest Wearable App Development Services In USA, UK And India.pdf
Best Wearable App Development Services In USA, UK And India.pdfMedRecTechnologies
 
Embedded Systems.pdf
Embedded Systems.pdfEmbedded Systems.pdf
Embedded Systems.pdfruvabebe
 
Guidelines for Android application design.pptx
Guidelines for Android application design.pptxGuidelines for Android application design.pptx
Guidelines for Android application design.pptxdebasish duarah
 
Android UX-UI Design for Fun and Profit
Android UX-UI Design for Fun and ProfitAndroid UX-UI Design for Fun and Profit
Android UX-UI Design for Fun and Profitpenanochizzo
 
Android UX-UI Design for Fun and Profit
Android UX-UI Design for Fun and ProfitAndroid UX-UI Design for Fun and Profit
Android UX-UI Design for Fun and ProfitFernando Cejas
 
Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti
 Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti   Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti
Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti Smash Tech
 
Creating Mobile Aps without Coding
Creating Mobile Aps without CodingCreating Mobile Aps without Coding
Creating Mobile Aps without CodingJack Molisani
 
Icons, Image & Multimedia
Icons, Image & MultimediaIcons, Image & Multimedia
Icons, Image & MultimediaMeghaj Mallick
 
An Exclusive Blog on Turning Your Website into an Android App
An Exclusive Blog on Turning Your Website into an Android AppAn Exclusive Blog on Turning Your Website into an Android App
An Exclusive Blog on Turning Your Website into an Android AppEdtech Learning
 
Learnings for Accessibility for iOS Platform
Learnings for Accessibility for iOS PlatformLearnings for Accessibility for iOS Platform
Learnings for Accessibility for iOS PlatformTasneem Sayeed
 
Doag wysiwyg
Doag wysiwygDoag wysiwyg
Doag wysiwygLuc Bors
 

Similar to Accessibility in Android - Enable tools like TalkBack (20)

React Native Accessibility - San Diego React and React Native Meetup
React Native Accessibility - San Diego React and React Native MeetupReact Native Accessibility - San Diego React and React Native Meetup
React Native Accessibility - San Diego React and React Native Meetup
 
iOS Human Interface Guidelines (HCI)
iOS Human Interface Guidelines (HCI)iOS Human Interface Guidelines (HCI)
iOS Human Interface Guidelines (HCI)
 
iOS Human Interface Guidlines for iOS-Platforms
iOS Human Interface Guidlines for iOS-PlatformsiOS Human Interface Guidlines for iOS-Platforms
iOS Human Interface Guidlines for iOS-Platforms
 
Navigating Inclusivity: Insights from Accessibility Experts
Navigating Inclusivity: Insights from Accessibility ExpertsNavigating Inclusivity: Insights from Accessibility Experts
Navigating Inclusivity: Insights from Accessibility Experts
 
Developing accessible android applications
Developing accessible android applicationsDeveloping accessible android applications
Developing accessible android applications
 
hema ppt (2).pptx
hema ppt (2).pptxhema ppt (2).pptx
hema ppt (2).pptx
 
Web accessibility is everyone's job
Web accessibility is everyone's jobWeb accessibility is everyone's job
Web accessibility is everyone's job
 
Best Wearable App Development Services In USA, UK And India.pdf
Best Wearable App Development Services In USA, UK And India.pdfBest Wearable App Development Services In USA, UK And India.pdf
Best Wearable App Development Services In USA, UK And India.pdf
 
Embedded Systems.pdf
Embedded Systems.pdfEmbedded Systems.pdf
Embedded Systems.pdf
 
Test your website for Web Accessibility
Test your website for  Web AccessibilityTest your website for  Web Accessibility
Test your website for Web Accessibility
 
Ui 5
Ui   5Ui   5
Ui 5
 
Guidelines for Android application design.pptx
Guidelines for Android application design.pptxGuidelines for Android application design.pptx
Guidelines for Android application design.pptx
 
Android UX-UI Design for Fun and Profit
Android UX-UI Design for Fun and ProfitAndroid UX-UI Design for Fun and Profit
Android UX-UI Design for Fun and Profit
 
Android UX-UI Design for Fun and Profit
Android UX-UI Design for Fun and ProfitAndroid UX-UI Design for Fun and Profit
Android UX-UI Design for Fun and Profit
 
Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti
 Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti   Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti
Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti
 
Creating Mobile Aps without Coding
Creating Mobile Aps without CodingCreating Mobile Aps without Coding
Creating Mobile Aps without Coding
 
Icons, Image & Multimedia
Icons, Image & MultimediaIcons, Image & Multimedia
Icons, Image & Multimedia
 
An Exclusive Blog on Turning Your Website into an Android App
An Exclusive Blog on Turning Your Website into an Android AppAn Exclusive Blog on Turning Your Website into an Android App
An Exclusive Blog on Turning Your Website into an Android App
 
Learnings for Accessibility for iOS Platform
Learnings for Accessibility for iOS PlatformLearnings for Accessibility for iOS Platform
Learnings for Accessibility for iOS Platform
 
Doag wysiwyg
Doag wysiwygDoag wysiwyg
Doag wysiwyg
 

Recently uploaded

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 

Recently uploaded (20)

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 

Accessibility in Android - Enable tools like TalkBack

  • 1. Accessibility in Android Sk. Arman Ali Software Engineer at W3Engineers Ltd.
  • 2. What is Accessibility • Easier to use by those with disabilities.
  • 3. WHY? • Most people will have at least a short term disability at some time that makes it difficult to use their mobile device. • This includes someone who was born blind, or lost fine motor skills in an accident. • This also includes someone who can’t use their hands because they are carrying a wiggly child. • You may have experienced difficulties using your phone while wearing gloves when it’s cold outside.
  • 4. WHY… • Maybe you’ve had a hard time distinguishing items on the screen when it’s bright outside. • With so much of the population experiencing decreased vision, hearing, mobility, and cognitive function, you should do your best to give everyone the best experience in your apps that you can. • It’s a small way you can make people’s lives better.
  • 5. How? Enabling accessibility tools • There are many tools that people use to interact with their Android devices. This includes TalkBack, Magnification, and Switch Access, to name a few.
  • 6. Enabling accessibility tools • TalkBack allows you to explore the view using gestures, while also audibly describing what’s on the screen. • Magnification allows you to zoom in on parts of the screen. • Both TalkBack and Magnification are helpful for people with limited visibility. • People with limited mobility can use Switch Access to allow them to navigate without using the touch screen. • You can find all the accessibility features in Settings/Accessibility on your device.
  • 7. Enabling accessibility tools… • This session is going to look mainly at TalkBack, as it incorporates both screen traversal for navigation and screen reading to understand what is in focus. • By using TalkBack, a user can use gestures, such as swiping left to right, on the screen to traverse the items shown on the screen. • As each item is in focus, there is an audible description given. • This is useful for people with vision impairments that cannot see the screen well enough to understand what is there, or select what they need to.
  • 8. Enabling accessibility tools… • To turn on TalkBack, go to Settings on your Android device. Then find Accessibility/TalkBack, and toggle the tool on.
  • 9. Accessibility Attributes Content description • You can easily improve this user experience by adding a android:contentDescription. • Adding a content description is something you should do for every image or button that does not otherwise have text for the screen reader to read. • If the element is not important to understand what is on the screen, the contentDescription can be set to @null. If you do this, TalkBack, and other screen readers will skip the element entirely, and move onto the next thing in the view.
  • 11. Accessibility Attributes… Grouping • To specify that both the elements should be in focus at the same time, add the android:focusable attribute with the value ”true” the parent element of the two, the LinearLayout with the id. • Also add the attribute android:focusableInTouchMode with the value ”false”, as you only want this to be focusable for the screen reader.
  • 13. Accessibility Attributes… Labels • The label is read separately from the editable value, with nothing linking the two. <TextView android:id="@+id/coffeeLimitLabel" android:labelFor="@id/coffeeLimitValue" android:text="@string/coffee_limit_label" />
  • 14. Accessibility Attributes… Traversal order • android:accessibilityTraversalBefore on a view to specify what item this should come before. <android.support.design.widget.FloatingActionButton android:accessibilityTraversalBefore=“Expected ID" android:contentDescription=“Add coffee “/>
  • 15. Accessibility Attributes… Announce for accessibility • When announceForAccessibility() is called, Android will give an audible announcement for those using a screen reader, and do nothing if an accessibility tool is not in use. • You can use this to inform the user that the value has been changed.
  • 16. Accessibility Attributes… Announce for accessibility addCoffee.setOnClickListener { amountConsumed.announceForAccessibility(getString(R.stri ng.count_updated, consumedString())) }
  • 17. Accessibility Attributes… Designing for accessibility • Google recommends to make any clickable items at least 48dp in size. That is because anything smaller is difficult for people with vision and motor impairments to tap accurately. • To solve this, add the android:minHeight attribute to that EditText. Make sure the value is at least 48dp. Alternatively, you could set android:height to 48dp or higher.
  • 18. Accessibility Attributes… • Color contrast Figure 1: Example of low and increased contrast ratios between foreground and background colors
  • 19. Accessibility Attributes… Color contrast • The recommended contrast ratio for text size is at least 3.0 to 1. • Use Accessibility Scanner Google also gives us an Accessibility Scanner that you can download from the Play Store. After downloading, the scanner can be turned on in the same Accessibility settings menu you were in before to turn on TalkBack. Navigate to Settings/Accessibility/Accessibility Scanner, and toggle it on.
  • 20. Accessibility Attributes… • Use cues other than color Figure 2: Examples of differentiating UI elements using color only and using color, shapes, and text
  • 22. Build accessible custom views • If your application requires a custom view component, you must do some additional work to ensure that your custom view is accessible. These are the main tasks for ensuring the accessibility of your view: – Handle directional controller clicks – Implement accessibility API methods – Send AccessibilityEvent objects specific to your custom view – Populate AccessibilityEvent and AccessibilityNodeInfo for your view
  • 23. Build accessible custom views - Handle clicks - Send AccessibilityEvent objects specific to your custom view setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // Send an AccessibilityEvent, since the user has interacted with the view. sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED); } });
  • 24. Build accessible custom views Populate AccessibilityEvent and AccessibilityNodeInfo for your view public void onPopulateAccessibilityEvent(AccessibilityEvent event) { super.onPopulateAccessibilityEvent(event); // Detect what type of accessibility event is being passed in. int eventType = event.getEventType(); if (eventType == AccessibilityEvent.TYPE_VIEW_SELECTED || eventType == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED) { event.getText().add("Mode selected: " + Integer.toString(mActiveSelection + 1) + "."); event.setItemCount(SELECTION_COUNT); event.setCurrentItemIndex(mActiveSelection); } // When a user first focuses on our view, we'll also read out some simple instructions to // make it clear that this is an interactive element. if (eventType == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED) { event.getText().add("Tap to change."); } }