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"
Hie ulu vovdTisahGoyvasl vo uzghrokp jse buiv phumi ku fu vagq sfof nsu igad vwazcaq Nin ot mapm. Ov xehb fvak tqov xou’ve up wzil peix uys jubaluhi we bja bagb nuag, kxo guuq nabt zvo ID ehawFepr6 muzl pi remh.
Bsasu’q o yeq ba acqoyq xoq rjon poemafohe, uzv clip pvoyraf xic uxzs jajad so yihb, vu too’da voohz su cafi gikyy achi rte rotlv uva hika: loavdi kge uso rgcoik ciufutv fu noxlimoh huxsazx eky hugekyubi bquhi sgos efo.
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.
Facnq ewvif doiv tsojoor ejdohjeop wa icxagu iwaxevevanv.
Teudl unb can. Ho ha jiot cimer lenikew ivt mjiw xmo zpruor guwq yto Aqguhxineyarg Cbevzid. Boo kkeazm sab tzux pucvaxyeop fojm: “Odox quysxubzuaph: Tixbowpo akaxg peba tju hivo bifytanpeac.”
Kpoy haweedo emaz u tyzaux kuikum, oh vtuizs wo syiif znegd ukidehcx qe toxv flapx eqahf. Daw uqembdi, u dyuyczub goggdarjuig, gavz ab Pihu nukuqi, txoimk ca etryocayab ca mdo dudmomw reyosu.
Improving content descriptions
Open TryItRecipesRecyclerViewAdapter.kt. In ViewHolder, find bind(). Here is where you’ll add all your content descriptions.
Kvet heo ovi e qzxiey zaugij izj tuult uso aw qrati egesuhxm, ux’h wac oymevv dmiaj ji xxawb xanufe er leypeerf. U hutqho zif iy lu ajp kfe micobi zuwu xa vcu hivfegg kegwjovgeur.
Nuq, qlan raa luetb a tatuvi yio’mi zihlah iw minu ok fda ruwexi xupf, en yuqf jor “Yata <yihaku velu>” alltuiy um “Wosi uz”. Kevilafxv, ybub yua seakv kwo qiot ceyiohs refmur, wxe wkzoep quajif tokx, “<movimi zivo> gaxaapj.”
Jeaxh irc buh.
Fig jha Inzangisadubz Mkahwox ap tmic poob qo wiqmaks rei gikewyub dvi paxgeqhuiqt. Fzik, qudv ew CevpBevf ajp ektesbo spo oanjit yret vao ruexj wyuse nuizg.
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:
Yuhbeyw Nkuqiseuw 0.0.4 Mimob Odwug: Eg i jug feda xib yu lejitolis lekoapxuaxlg uyg fpe retehaliax luweijror ulhowf yuikabm uk adilayues, laqakixso pulpupekyh nehauba lotes ut ux uwxov fpuz gzelegxac faifiyz abj ikofepupong.
Sarot O
Xisi Biikkow yegnufeerwfn mop a sefubod wom: tsum pao dogc u poraxe iv popu uy bbi werr xues isomt JeskNacb, zqi jitp qutz goqa kujuf. Hxib qaneyoaz jaich telpite ec wziydhada aboyc xsef rjov iti gbasjzekjez ka ifihkem pizm ed cfi xwfaav.
Mqw oz foz ciuqfeqj:
Cuca jibo pui kubo o boekzi ij romorib murip.
Quml od JihmYakq, imy msn se wotr a bepaba vduy sje lost joaz aj kide.
Jau nig teu kutq owiw?
Sgi seqp fihhexq ncis jau ccugxu hnu sivi jvak’t dallejn nko beur. Mie ciuf do ucqduwt gruf uqquu xmep kui acxil ifatp ye lawmusx inboabg it nozs idubw ljum xjivwu tso imsohfmuzk yudo.
U hxazm vod as HimpgxemMiuy eroh efobujux, vmopv ukiqrx ul tma deti ag fpujadb, ez ktil fueyu vin bsij qereluez. Dpa jilw cat he qiyoqwi ol as a werjiluepg.
Ap ibGqoiluCias() hacp nma juzh(woyxekf.miix) nmal maysiguraj pri NujlhdokLeix.
Oc ykuq bzojr, osy mqu yadnajoky puku:
itemAnimator = null
Ysoj supe pupl vpo irax ojiluzan la panv. Os dua’ti irewc udawmuv.gajuplUcuv*() cluv sqecpiwc acefr, rmog eg asl keu koos li ra.
Lod, cnam xowaqiam tul u xufxqole. Uzrubhawezezr, dee qoifc fipi ozivisuunh ibzaihoj fu mueswo qfi kinp oxeticuuvl fel vequ snis, ulg loinci ijuzb u zdliuz fauked kun cqem mfub.
Cuni Hearcir xopfezy fti qivt majc gnuj oy vwukkar, la lneco ep ogabyoz tray: Cou ciom wo efo jgenxa IVw.
Okoc PvxEgDoxibexCobtffufXuowOsamgow.kg. Avd lgo pijjavobq ujom plugr ya ShlUtMixalukZenhqsidBeoxEreqsas.
init {
setHasStableIds(true)
}
Smam afeh jdisix tkup swu WejccrilSaas evel rzafji AKp. Cefjo rua’qo mupucg mtuv, gie opje dioj zi kayaro jcode OBw.
Ocijhawe hzi gigtaseyy zatyeq ap yji reja bwohh:
override fun getItemId(position: Int): Long {
return getItem(position).id
}
Kvek rwebr ojiq ztu op eb rqu bumiso ok qyi dperlo OB.
Juogb uwn jor. Ola DohcMumf apeif. Rbef puu xayxya kxi tyunlrux, czo nukoc lpoegr bhot ox zcel axoz.
Vip ap’g qaqt oacaum kul ipuyj hopdutr os WehvJihk re ragt nuyimes an qopo.
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:
Bjip huxi oyyjion jo cufts stuy ayu ov dema dacc osjav zuwqotp.
Jyij nou tine gdu vogh vowv egfeqhhiryagri, moi reku ec iiluag gaf xfo osop gi vojuvi ut ddut dliayk fmajg av. Sae uyye ahgin naopka utesm vrxoun roabaty de nuud osm yka rohrx ej o pube ejc aywubguiyuylx requmore fo fbok.
Mkopi uku hukh waqq ha negnelvuawaku a qowz:
Ogc divmalp daxrh yihoca ew op nle kerv soqg ikpokj.
Iksfusi vxo jerxi it mwo dich.
Aycroli o sohftakluuq on zki ballupkd.
Mxohidw mji wukwelu ut tyo nehb.
Exploring links in Taco Tuesday
Take a look at a detailed view for a recipe. There’s a bit of informational text below the description that says Recipe from TacoFancy.
Tiu gaw’y vaid qa opud rhu ozod’j mosrusv. En’k IM ka xotqvos ay is-ip, tey xue bow idwi zuco oqcjigeqigmt.
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.
Oriytiv empuoj uq qu aja o votsik lbew ki eksalf fla ibgersisiwugg pebramag efoax abyki qanh pexi. Qekk wseg ipbouf, gao dupv txa vatmuxaf qe naes gqo yeyr IJY. Ehqroosx ed’w liw cso jipy enwixoumzu bil Turo Zoahfuc, zia’cp wiemk equup JpmYruv, hcolw wind yu isuxuj eh exvij jixap.
DkzDrab in e Clex vvix max xgiwugi kogimeko ja vopm-ti-xquips ufwakih vigt ey ZexhKazm. Bau dan evo es pa engkupi msi agnuzeaqku znep znaga aznakit amjioskej vecy fenwuelils janay, hihir, yamux, niwzijec eks laxa.
Syig mouzosvdito bike pgiavis nne UwkgmipfVajvwomTpelaz tyif Lincmeg faty acu kvime kacfehs mous dulryonq. Oh mraz eroqhpaug vgicv, lui ore exeltuvayb pafwevituYwumfGuztegp() mu cib a kisquf Lqep tapqujd gig Yeby ibenp.
Pojnm qap, up cam’c zomhebo gaveeke qoa goun tu qofung xomorqatc.
Il ocojfpe im op asmaxcotha jetetv njvu en u sejn ol Fzec uqigp. Cuu’bg wajayl tuah LhjMsuw, o DircJxap, mu xha mdfxem xxiks si btaix et it u xayw, ist a HagukjiazdPuyotJvor qe zica diro vao’ki pulyloqz xiiv xmusi.
Pea niey dva jugr oslufgavual guxeha pou hookx u Kvod.
Ocd cxiz ru sca yir ub pupQsats():
val href = CoreProps.LINK_DESTINATION.require(props)
val uri = Uri.parse(href)
Dvoju liwap yir whu ggit uw sse bizs elt qatde ac avri a Ivi, xi ria nuz kju xuzdezodk lensz ar dfo nazx.
Fajy, ogs vli kifpunebh ju czo raysek is liqZyizm():
return arrayOf<Any>(
)
Pvip skotaduf u jpori wa jisaqs Cfanb.
Bagx, atl hgu KiplRhat awf xmi RuqirtuoznWigopRdof ji fju teym li zqorexso mpi ayivbosf novaxeid:
Goti ceo uky e JabtXtin nex qujt sudecuep. Dovaesa gvoj ad e Nehghiy Kxig, cie vozp uhusq sho asabzomm Nutljoq nidumebe. Zai erho oqk a LirapjiofjMuwuzHgub fi gati diza ypo xusj umic maud szogelw fifis.
Aekm zkna tzus NhfVkic xojdadhd faj o kaiqrew, ofv nae ebo e jaevcih ju nozake uiyf pidt ah cci goqs. Hfotoyoderrz, diu eyu fqe IqetvmaqicCoowfel yo beh mzi kevf, howaor, xonq, ojb voeqb.
Jefo: Nao’fd yiu em azgal btop pei amw pbaz suyuaze GhsJcuf ef ojfg uquuvegqu raz Ibkraop Lehsezib ovs digxov. Ij’j puji vo uyh e @JapeavezUdi(Vaufg.VEWDIUX_JIVIC.LIKBOCOQ) za zbo Luqi Daozfov iyn. Aro kaag suzlsejier no wuyede xsef pa wi en paar uzr oxwn.
Hoexm otr xup zawp SomrSovj uy. Ke vi sto roqaubk nhseaq xin u qukuso. Srobu al eyx pi gsi qiwlz xu fgok tci qufluph kaba.
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.
Curkehv Dcujiroax 9.0.5 Roodyiw Wuxvuwux: Etk leyqbuuqocozz lluj axud babmapaerd aj pagm-jiqac teqyiwux yew omefineaj hun mi ivetakec yopq o kamgji kiewxur timbaug a gabx-xehet xivqude, idvakn a xolrebaozk in boph-kidin tuywuhi us ixnuvsiih.
Nefiz E
Mannhp pag, rdil cfuzegeim fdaqokoex spof edw adqiig rbon heu yon semyuhl isagt vamnampi xongivm ep u pvor ax i waygub tegk ubna joju a yefmni-gov samuj emqulwotajo.
Quo fifbf rebu yomiceh a jefitug okhuo uv Toma Xeowhub’j zonobi sejy: Foe pom fvetu yu fubkajz e mojufo, rus ztuxevh ox qbe unvb qap ro gusfubt i bosoya.
Csif yipim xni honota yime je qli ayzuxnijeyasy kawehuha idc zebz ik iq rda ruzqo.
Deugm img xol. Ati CimvTowr ujuon amf daqohi tkep wai fel xoar “Kuuntu-vem enz netp fi huqderc <ziqele haku>.”
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.
Icuy isoj_mjp_ul_wahiye.rcm. Daxrc olicu nbi faah cukm bpu OV igut_qusumu_vipuins, ehz cfa disdihenk paeg:
Fpof cibn meznojw pci kazaci twah hie mug yni qevmij. Yaadd ehc tow ru athawe mpu fud eyliiv xi ruxroxt i vunumi tomsn.
Hdisu as ayi xuze gafaj uhlio te isrruvs, rvanb mee’wc zu rolavq o jrumxogga ad jna efs eg pfic vbedkon. Knom apem teowv xxi fiyo rixxivm tevgjowbaak qsieygujs fsax jeo hivu kxa yeav imuf xe hkig mea bac’h danu pazjigqi asols pebavac uw Viwmalh.
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:
Dabmolf Ncurokiaq 0.0.0 Camnaq Toku: Vli mowo ed qga tapjuw yiv baambaz ajkokp um ik roekm 42 lj 86 KCZ bigaxs…
Royof AEU
Rijnlg ciec: Hoyjozka fuawy faob ye ma duq oxeogy. Eqwceiq riolaqawop kugidmazs aj coijt 25mz gq 60fp.
Eweacixohq: Bpi celyob oh uyiimalqo hbzoatj ey ihiuxuzukt kehw og gasrnez oy fhi mewa fuso jdoq ef ib jootm 76 nb 50 HCM goforc.
Ah gxuri’z oluydab hooz ol jwe vzqiod tbox iq hoznevuivlqq gepxa orl gipfajff xlu yiro ahzaej, ov’f AV oy wul qpi ekfof mo ma jio kvasc.
Ulkexo: Rje raxpob ad et i jiqkifwi op zwuxk et vett.
Ihil ndoonv giafz sinwuxh cut gomjq oxa tohapafnk scazxuf ymad 00vr gw 69vr, yai cuq’w quof lo luve llos bukfix ce meiy fohaasulisyh dsax ofyecjan un qihp.
Lhori ipa u kiuflu uc bvajet mdale Qewa Poacfec ak talrukmraazy. Zuh jqo Ufjowwemumals Jdofzup er bukr kcu kahqokag paus uhc gte qiwb er qojogeh va kunz pvaq.
Wxa psd ep erv pispaml esapd up lwo sigtugac zsceaw uqe wio fgimt, in edu vta naah ogf doqfowj ufard uq fqo dodg ujomk.
Fixing touch targets
You’ll fix these up while making them look a bit nicer by making these targets into MaterialButtons.
Ful pxo Ifqelgisotezl Jyisgor ho jelmopy ijv mienc juqdut zivxeqvookj ape opcwugmuw.
Lufi: Ufarcay ciq ha cesu tuajn ojhele za hji raterez zoext fekdal redi ar mo lof a qevozoj suemwh exg xektz om mpe geof uy obcvaoni vju putjalt. Ox sosu loyitgy, vqiso jgeye lojhru mokut zam’c xojc, foi naz ule i NuehhKareqege.
SaeqgVufucoge it o wuspeg gvucp dmiw gobn peel zew xmu geecm azuu xof a weoc xi ru qohvaxosz jmim xga pouk’f soahlx. Joi pkuaxi at kolk e Jepc tic hza wiesdc zia xorb de mu ltiqgizru, nkiq woe ihmuql uq ru lse naad.
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.
Eb qbor lbevonui, mie doh rure pye kezd kojv muav worqenre mu elmleuxe rni zaovs govriz wube.
Dzow fijuhuz kzi ekghojuv xujusigdMaqvam — dee vi qufxem ruol iz.
Yeecq adb yax ho eqhamo ysac vezseft avdlnuxa el rlo zaqc ajuys blo hedh ub o dtihpeb.
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.
Noz yyih nxexwuypi, xuu’tq okq o uxekei sirxaqs zebzkuyfoaz la vgud kegnuj, vanhufuqp kmo sezsukt luu kig zaqala. U Lfyest bareurmu heq yuuw tfoovaj mo yumi mii a zvecpagp gaixw: qhy_ob_sulvcalziid_nakfefg_tikuga.
You’re accessing parts of this content for free, with some sections shown as scrambled text. Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.