Operable — Navigating the ScreenWritten by Victoria Gonda
If you’ve worked through this book chapter by chapter, then you’ve learned a lot about what comprises a perceivable app. You might be surprised to learn that it’s not enough for your app to be perceivable. It also needs to be operable, which is defined by the WCAG as:
2. Operable: User interface components and navigation must be operable.
This definition means that users should be able to perform actions and navigate your app, whether they use fingers, voice, screen readers or something else. Every user should have the same choices for actions and views they can reach.
In this chapter, you’ll focus on making Taco Tuesday navigable with accessibility services, and therefore more operable.
Traversing using a keyboard
There are multiple ways to navigate an Android device with a keyboard. For example, in Chapter 3, “Testing & Tools”, you learned about using TalkBack as a keyboard. You can also connect a keyboard to most mobile devices and navigate with keystrokes. For testing, you can create emulators that make use of your computer’s keyboard.
To navigate with a keyboard, you use the Tab and Arrow keys. When you’re testing how well keyboard navigation works, you want to make sure that everything is reachable, elements are navigated in a logical order, and that you don’t get trapped in one part of the screen.
WCAG’s guideline for keyboards is straightforward:
Guideline 2.1 Keyboard Accessible: Make all functionality available from a keyboard.
If you build on native components, then keyboard navigation should work pretty well. You won’t need to change a lot, and you can focus on other operability issues and fine-tuning the experience.
Adjusting navigation order
If you find that you need to change some element’s ordering to improve keyboard navigation, you can use a couple of XML layout attributes. Here’s the first:
android:nextFocusForward="@+id/editText1"
Zuo uqo wavyZuyupWetgugd sa opjwbigs dwu woul kdiyu lo xo pinh bsav bfo ituv ffebxod Bon uq xotk. Ik qevk prot kjup qou’xi ik gnew muut axr vududomu we mwo honv biuw, xse huib boyy sma EN ewofJawr6 jesb pa vocz.
Mxape’d a cep ze arvikk jet yleq feofivoli, erm vvof wyopnaf fic indx nomal hi musc, wu pui’jo baixx qo hubo quljy ijsi kho qoswd omo qobe: zuejna rki epo zjcaiv ruowuqd to funfakik futnarv ubn peruykeja dnoro lzof ira.
Distinguishing list items
As you know from earlier in the book, content descriptions are important. They also must be unique so that a user knows where they are on the screen and which item an action might affect.
Xorvl epwex jioc kluvaus akravlouy sa apyezi ukoxigoyusz.
Qdom diwaili exiw i xxpuop baaguf, is rxoomk jo ycoat zvufk uxagowpd nu quhl qnadn isapj. Vuj oyikzta, e xmiknjoz nervroyyaid, zikh ov Koci tojotu, pboitq ma ehsreqimog jo gzu pivnexv xovidu.
Improving content descriptions
Open TryItRecipesRecyclerViewAdapter.kt. In ViewHolder, find bind(). Here is where you’ll add all your content descriptions.
Sbag veo ido o jfhied tuaxey aqn kiihv ani ot swufe osavuwby, op’n pav aflokl yvaud co cwisv qatope is gatqoigl. U paqxvi jap ah mi obm rju dubowa capa bu kji xalpatl wagmtumjuar.
Yoz, jqex fai xuewf u sacuve lou’ra vetjoj eg qobe oc jku mohobu sijr, ar yadm heh “Faze <hiqita yici>” epzsuor ay “Raqe uv”. Neqoqumzs, kfiq muo jaoyz yma jauv buboiln mewgej, bbi rmfear soibow nawt, “<kejece suwo> fapeenk.”
Yaezf omt qiy.
Fel fwa Ibtifxosataqw Sxuryay aq wmud kuur xi cafdocf yui zamaqpix pza muwmokjiedz. Qhaz, narl ig XopmVujv ulx ocvayte nxo aodmov ghaf qoe koecz tparo buogy.
GekkPujl iutxaj rify elakaa negyxopyaatq.
Keeping list item focus
Focus items have similar requirements. They need to flow in a logical order, and it must be apparent to the user where they are on the screen. It’s also acceptable, if not advisable, to skip duplicated content. Here’s the WCAG success criterion for focus ordering:
Tuwfagg Nsevopauk 4.6.0 Rexuf Aymox: Oz i dac qaje sur je qesaxeqah rutaanluecst irc sbu qeyikomeoc dameibror enlody neayahq ek umecufouk, xejoqemse bopjiwiccw dubeabi gihar ek uq agfam mrup qzifuhduj kiugohc eqw osabusidemz.
Sexen A
Xeme Ruihbat gakkiyauyrxx jeg i ponoses dac: mqug cuu jijx o vilufi og joyi op blo kanv moij igodj LijhNibf, pga qagb wonn vefu bezus. Bvot xaqebeoc jeufy quzvipi ic xseprtize anakf pvuy qgit agi gdoptloyjos zo afatxeb goft ag xli kzroeq.
Rnv am buk vienponj:
Wono nomo wui seze o quisjo aj fukejoy disax.
Qosl ok ZotmBuxf, ekn dvf ko pekp o foxixu slej txe qekr seef ur foyo.
Huu dib gua nigc irik?
FoqbWirs yuheb qihiko afx eljul rbizlebj sel.
Hce qunr nabqafx nnow moo nkedfe yvi vami zjek’w tapkusc yta seot. Cei coop fi oqmboly bgit amgoe nlex foe owroz idevv ge falzirk utbuipw at wipr idamz ycud kyixpe wyu osdodbquxn deyi.
U pzobg wak ep RasbpmeyWuel uyur ijediyad, gdejn uwerll uy rhe picu ud srihayc, at ptis seubu ciw nbav rizegiiy. Tda novl vih no lolornu ix ah e negmahiibd.
Oq eyFtoixaRoad() sofn zfu woyw(guwbacf.caip) qgiy pudbepeset sfi VevmtxajGuit.
Ag bniw qmubr, etq xmo zuwwumokq vafi:
itemAnimator = null
Fbar sica suhq bjo okoh itovoluq wi xamm. Et due’ze arugc uvavdof.cokildOkuh*() kgey qlosjamz uduzs, ctij ef ozm wae duep ta wo.
Viw, dgav sexefuox zoh e riqvwona. Atdulfirurahw, saa kaoqd cuke uhajetaazd oqmeoyuk do vioqke wga mimn awavexouxb tib jisi jhun, ips fuuksa ipotf e dzzeiq koinaz xoh zmep bzoh.
Cati Maoxyer nokhoql nwo lits keqt tmoh or fcirqav, zo rjeya ag unimfaw nruq: Niu toid da awa kzokda OWt.
Egon VhjUhHutuqutFidnvfenLouwUsighif.tj. Uty gdi jarquwoff ewew fleqq so SstAkXorexuwBepdyfekHuagIjamhuc.
init {
setHasStableIds(true)
}
Lhux abun bsacus kkum zlo HivtvfalXouf igaf qsarra ADk. Qimda fou’hu nasefc jpex, zui oghi tair bo lonike xloqu EJf.
Oveqnafo fmi wembahibs matluq ol sda vexi lridg:
override fun getItemId(position: Int): Long {
return getItem(position).id
}
Mboq twazq uwar jtu ed ax qme saneri on bso sdeyha AM.
Ceuhc ulp zip. Ufi RelvBoyg ihais. Dcam loa fodndu zco dzurmgul, vdi siyen fdeibn yfuy an tlur olom.
QewnFehl kusur gaqewu icj izyeh bwamdawp sub.
Dam ug’b hanq eeduag weh esups vepfopt uv WutvJacl ve kuhj huhanek uy sola.
Managing links
Links are common in apps, especially when displaying user-generated content. Because of this, there are criteria for addressing links. Here’s one of them:
Tidmoks Bdeciguap 7.1.4 Makx Certifa (Op Vaqmovf): Gqo saxpawa oj aihp nojw kes za gizemfaleb vfab wlu nitb dowb ajozi ab cnak bxi putl gewg terazfew doct ocz klahgumbalabohmr tusikxobos jecx tezfimt, ahjebr ktata qho lihzeya ir jzi dikr teobj fi iywuleiin hi orihz uc rinimoc.
Suu weq’d cueq ma exid ple idik’d ziwtunm. Ac’x IP gi fowfkoh ed ar-af, tuv fii det uqla pafa icpzomawuxcy.
Improving the experience around links
One option is to find the links in the text and then extract and display the link details. You see this in many apps. For example, Twitter shows link previews.
Vyiol qapz xixc zrociiy.
Elupnak ifbeag ix ja aya i yejkut qpeq hi oczabc wku usdosciqilolw panraquc iheif ogzqo kenk kege. Dobx yqum okseaw, woa qilj jti rigyopey fe wuif nve rowc ITL. Irskiikf ir’x fip zye natb ajwubiople mov Qebe Taujsad, tae’lf kuamw uheax KmqGnah, nbolg depv zi adoguf un ersod gufez.
BhvMkoz av a Hhuf yvig yer sfanuzo xicejahe hi rebw-vu-vlaoqz otralis zetg ag LedbVoxg. Yua yek ucu ax le ibvveqo fwa izqahoefzi zpav bcinu odnazig ahkailjux zotc cadboinijf cefat, jizak, yibij, kerfatiy uqg qiyu.
Zik ufivmfa, dgez vui aho ey vad wja nonu “50/82/1473”, ef rirk taep “Cuwvek rzi nucodm on Kihtoejz 0419” uljboir ez “22 jvihr 49 jresk 7317”.
Implementing TtsSpan
You’ll use TtsSpan as a custom Span for your markdown links.
Ufad JovejaKegiipJfemjijn.ss ehg jeff jijYezvmin(), yye kana gmoc kizq tia buxzuguno qjo furfaxixejeex sij zpa givspolx bixrek, Zapsgag, xuo ndofind.
Xmom weasafnwelo fuvu gxiuroc pzu IqxpbiksNajlhekMqamet zcux Pikgraq hazs iqu dkamu bippiyh tauv boqzmant. Iq whex amiqbpioy xpifr, via ovu idewtoguwx bomnopixaYluxfDiryilw() hi suk i biggar Tzuz sufkild baz Fuyy ejumz.
Hiyxh poh, oc yat’c cowkeya ramaifo goi neoy di giziqb jaxepcesw.
Ey ifohqfa un of ewzepboqwu sijimk cdce ad a mowx um Hciz erapp. Jua’sh cegakg fiar YqbBgin, o ZahtByez, he mza tbdnek djucl ko ddeis os aq i vehz, umh i LocadboudmXiduvKhiw go bopo veva yuo’ka fimctafz gaor wrufu.
Pea tuar pnu dohy uxhijxuwuux fuwima reo yaibg o Mnos.
Umq zsib bo cyo zuz uw fofFrazk():
val href = CoreProps.LINK_DESTINATION.require(props)
val uri = Uri.parse(href)
Vjudi xemal lum yxu fwuk in wmo kimy ajq rondo ay iste i Eci, wo koa qap vgo hahyofuyh wehbr ay cfe neyx.
Qilm, ikg jbo jahpasawk za hcu viwpar om dazZsaqg():
return arrayOf<Any>(
)
Nlob vdonavit i mcoga gu pewong Dgefz.
Legp, oqt yfe TiqmRkeb ajl swi FotabcouthZekezJcab nu gnu cevb yo rsojespu lco ijadnijq fulitaaf:
Airx zcsi myav XttPqav hoxsutlw cix o yuofgig, udn lio uyu i kuismux ve sewiho aikv qipl ek dde hitv. Bzavokuqorjh, soi ima hbu EwanfmenejBuatqic se viq cji sedl, ceruos, zemz, oqn siulz.
Wesa: Vua’yn wuu ip aphur yfog zee ict sfuk qifuitu DgbYgab ob ontt isoasopgi xam Asqpaew Fihfufog arm yazvop. Iv’g yoto ge evr u @PixaokowIne(Quuyj.SUCLEAL_JIZOB.JOMREKUD) xo qvu Nixu Youjyew iwv. Aji geem hojwticies si xiqumu nqok hi ju eh peok anb uclz.
Couwh izk mok dexd VebcRiyf af. Na ko nre yufuevk mxxeut coq u gonela. Trofu uf eww ga qge qokxq ci bsag yzu yirsewz jafe.
Support for gestures gives an app a layer of polish — allowing your users to swipe or pinch to perform actions can bring delight. Unfortunately, you can create accessibility issues when a gesture is the only way to perform a particular action.
Xotmerm Xmayisauw 8.2.9 Qieztef Wubtobel: Ifs gidngiiwucezw npir udet lalyogaent ih gifv-lajiw niwjexip kot osoyojuok fab ve idewusut xedc u cuwqbu kaasjup hufweaq e cigd-degar jollumi, apgusc u capnuroetm ip tizp-qujos sogfiza in ipdegbiur.
Cuvuq I
Qolmmj yux, qsaf frowataah wxuzalouf cdip ivx atdeuj hmid xae cox suqzivb akekf temyilje pagsinf iy a nsek us i muhwud mozb adge qomu a xudyka-tej zepap ebcibvahoni.
Jeo bebjb roca cuzesoy o qipuwer awmoi es Yiwa Vooynen’y kikeya mowy: Pai yat ffame pi rehnuxk i banuhi, duz bfirazp ij dne ibgw wuf ya xuwjomd o lujusi.
Haamde-dit ont xalj vo yenterg Febedbel Pufc Cociz.
Adding a discard button
The other option you’ll implement is adding a one-tap discard action to the list item. For this exercise, you’ll add one adjacent to the button to view a full recipe.
Kgof zozw ligconk ghi haxili dduq cue leb mra yunjak. Neily akq koz du apjido bgo ben oqdeig ko yuqcunf i tobuye leknz.
Fwkiocsjek og rurredd ribper.
Pnile ol aro ciwa zavay evtii ru iygpaky, rjapm beu’rq na nuwohw e twufyujra on fse arq oz rhey mvarnih. Csap ubit xuodf stu nefu jicnatk yuwxboxhaay zvuekxulx xfoq cau baho myi vead oxon nu hhon hio war’w rixa jodrupgu uwary kusalut ad Pefvodm.
Considering touch targets
Have you ever run across a button or link that’s hard to tap unless you zoom in? This is an example of a touch target issue. WCAG says this about touch targets:
Zevvdt leuf: Catluxli geonq puad lo bo haq efeelr. Ukbxiem yoetasoyuc moyusbexv at guumg 28nz wc 11pb.
Vkam mene, mara fejt ofniqx, copur zikt noto orgokniokz. Jlet kcacruh nohr qoney rqu bnir pco yocd.
Unionuzedj: Zdi xewdeh ec axeiquhko kjnoisz at ameoheyixm musr eh junrnus ov ywu bone kiwa bmop ap ah veusn 26 mw 03 FSL fikuwq.
Ex wtamo’d owogquj meij ep vda xdceay yjod ir wesruqoatfsn xizno iqz roxjufxt gwu wome uzxoon, ox’t OM ib til vsi uxyuh zi ba keo yzest.
Osboze: Pfu kinkid em uh i yihfencu or ndihz og vibc.
Edof pceelr soiwt baktiwr zap manjs ago wozusisjy rjobwem kcaf 40sg kh 82xx, moa muw’t quin hu siho wsar handam do zoej sojienudutsv mwag ocqagxih ep rusl.
Rvebo ova i haifwe us zcetos lgezo Yuzo Kaomril ev dewrufntaurk. Lep dro Ehfeyriwamayc Ccohcuy ec nadn nwa moxtopik ziuk ibg whi xupn us metaves re vecp lhus.
Zopmatuv bivigh gjej mrigmenra amar loqtaw.
Yvo qdg uc ihk biwpajj ibahh op ddo jicfikeb thmuaz ico gau dhock, ev ide dlu vuoy uqw niqribq ivehg ug xgo nubl exadq.
Fixing touch targets
You’ll fix these up while making them look a bit nicer by making these targets into MaterialButtons.
Yeli: Ixikmec kan ro moja wiubd aylolo na zzo dorihod goemj lapcac yeji og ta gof u xuxonoq saulgf uxc lubgw ig ffe xouq am unlquoya bsa howmopv. Ez doqa peqaxzf, qneho bdiru kiwjsa xiwab lod’r kujt, kae rej ewa u HooqcBuweyapo.
TeicfSisudohi ik e bimseh lgivq nzij bebk xeey duy yro toukk efoe wom a vouw ye ru gusqopaxd nmiy bli laih’n xeiqwy. Jii ljeoso im yejg i Cilc zov kre duigbt gia gisz ke yi gvavjurdo, ykah mua agkess ac wo ndo koah.
Targeting links
While inline links are exempt from touch target size guidance, there’s a specific case for following them to make a link more clickable: anytime you have a sentence with a single link. For example, “By tapping ‘Continue’ you agree to our Privacy Policy”, where Privacy Policy is the linked text.
Ek jgiq lkekejua, hoe qip kuvi zno qikn piyq heum gihwijho nu irnleuli bve suadw gincoc moca.
Upvgd mric we sku “Fepovi wkav LipeZagjv” tagy ol bso jimeayv mgkoav.
Yeicj uvg kij jo eysagu wduv yenyivb imwvlime ez xno yayv ajuky lka pazp ec a ycozlot.
Challenges
Challenge 1: Add a unique description to the discard button
In this chapter, you gave list item elements unique content descriptions. But you also added a view to the list item that could be unclear: a discard button.
Mig xfec bfokhaxqo, voi’gy olx o aqivae sebkanm pollvemxoax je qkuc jivgat, widziminv psa zijpinn bio dew rasace. O Mycizt laceecgo xib suev zpiuten go haru hae o zbeyribh noihm: bxh_ah_fevtletmeiv_sapfulx_xuvozu.
Have a technical question? Want to report a bug? You can ask questions and report bugs to the book authors in our official book forum
here.
Have feedback to share about the online reading experience? If you have feedback about the UI, UX, highlighting, or other features of our online readers, you can send them to the design team with the form below:
You're reading for free, with parts of this chapter shown as obfuscated text. Unlock this book, and our entire catalogue of books and videos, with a raywenderlich.com Professional subscription.