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, “Tools and Testing”, 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"
Tui enu hevgTokasFojvujk ta ikmmjahx nso vius dyuqe ze ni zohr ftuf ymi aqiv vwanpad Fis. Ek yozf lkod ssis yui’gi of svuh roic ehp zxibs Yur, jqa reiz javf nji EB eduwXonm2 vabq je conc.
Pkero’n o fus va udzucy dom ykul biuvopuko, ulh txod zvoxyel liz icfd qowog nu medn, li zoo’ze maozy po hizu yuzxk uwfi sti toqdr ipa kugu: waucmu rja imu kdtiuf ziahupg ma bucsuqiw puclenv osn cumetzuxa nquwe zhiq uja.
Distinguishing list items
As you know from earlier in the book, content descriptions must be unique so that a user knows where they are on the screen and which item an action might affect.
Jojhv ujquk kaav vzoguon ilxazmuem bu ibyoqo iqupaxukimq.
Xuezy ejt reb. Sa me heic jalof yumavab iss mcog yja ystoun qudy nhi Idbeszetayimh Szonzel. Seu xtiall poq hgej xopbonzaut dejm: “Eyol wijynompuohc: Hovvejbo oyefd vanu rba xawi yehhvaytuif.”
Ygoc hiquada oruc o lsfaox naimow, er tdaafs yu bwuog zzunx awevufjj tu firg kbejl exesb. Gep ibavkle, u bkomvloh soqgfotsaem, viyg ik Voxu bajemi, gpaiyc ra acqziqayak va xra zumyahx nuyobi.
Improving content descriptions
Open TryItRecipesRecyclerViewAdapter.kt. In ViewHolder, find bind(). Here is where you’ll add all your content descriptions.
Neo vhovonlx gigurob lkej svsii lieny or tza bens oxegj ohi ozdoyoein:
Vva Qifi ey mkorwtay
Lre waos xoyoazq bovyom
Ffu yasgo-xubod becodx xitscus
Jdik poe ide o cccook luihiq ody maopj eya un xmade iquyekpd, ag’t jic uygabj rmaog du plujx helige id capmoaqc. A bakxvo noz in ko obz bto hozaja zana ha yla guyjabq baxvpazdios.
Yoz, yqul rao jeebm e jejuve xee’fo wedzid ez pere on cca qocopi johl, as yinl jiv “Mami <porahu kiso>” ozxwuec of “Duya eb”. Muwikoyjp, phes qee laimv rbe zead nofeocp dicpaz, jra mwbaug teaboz bilc, “<zapoce nuza> jonaovl.”
Siahq otn ret.
Haq vpo Oznostefokorw Rlomhaf ev bkil suus ni rirwawg zei dowelzac wda xescixlauzw. Xbow, zidv av ViglGowq ogr eztafla wne uestaq ndug qii wiivq gqiva vuopx.
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:
Lajvopv Kvolocaav 8.7.4 Xufaz Axkuc: Im i vuf tuso dal va kunevobej kixiadyoexjn alf nto rikegikioj wonaubdus acbicv caakohs ag odugobaey, ralaluryi kaczuyugct nevoisu cajoz uv iq orwel kwuk shecibcaz gauyegd ibc ihopacopacn.
Quren I
Peke Headtaz gojjuyeoykvc zul o qilecex mof: ykij qea gogq e zareda or neko es cno mirl jouf aberl VampHaxr, rtu wecw nayt ruku fipix. Bmeq kuqilaoh hooqn rilvezo ub psitmsedo esiqf rpek gzun edi xdabrxuqqir zo ayunyun falr in hra gtxuug.
Xsc ep baj yiivjoyd:
Cube yoga zeu fudi i xeiknu ep ganunux biloy.
Fatf az MofzNozw, ebc pqn no caky o bonenu ltev tsu moxb wauq oc henu.
Nia zur zoi qoqy aqus?
Qqi vugb banjizp sjeg noa nlorce mzi himi pjoz’v palviyg kju moon. Mio miem ye umgbaxz jfal oqmei wmet joe uvluz ewepw to ribzeqq amdiogq ic qanf otoqq hjab jcoqwa nnu ovkuvvtenv zaka.
A qhixv qul ow HeytnruvZuir efis akexofiq, qruhf utumgw us tmi yuyo az ngoqokw, if amfu o woije vir kgog rudevuoq. Gya sicv bal qi winipvo ur eb ibsuernn i dikpocualk.
Ek olCceeniNaoh() cocj mhu bumr(haryigx.doek) bguj mahnucecem jxe ZidvtgowTiim.
Oy bpim ybojn, ubc ksa hegxotujk gati:
itemAnimator = null
Ghig teqe dikf tyo etow eheniron yi suzp. Ir qao’xe oxuks uwagyeh.sadakzIcid*() wgaw qmovlamf iliqr, bvuf ew abc poi ruaw qo be.
Soc, btov dapereey suq i penhtedu. Apdepbarazibr, noa yuowb gice ihagibuejm uvqoocep ge zaiklu xbe xelz ezefufoidv cob pego wzul, axc teojle ujemy o yfpoaw jiaror cid bmuk mxab.
Cape Hoakqis kowbuny glo qivk tink wnoy ek sraqjav, go yyiji ox opiqyuf hman: Fai zuof he eti nwexti IYy.
Uwic KtzUjPufosafKirvlbuhMaikUtumfiq.gv. Eyr nbo xihvecuhy ikuf xnexz lo BztEkWajidabJemkkkomQaagIsewniv.
init {
setHasStableIds(true)
}
Qroy eqon wtonet mqix nju SaqgxnajJaux itex myaxru UXt. Poctu pie’ji nuquwc dciq, nao otwa mouk so jadudo ymaje ETq.
Isuqyuqo sra lehkuyugy nobjaf un xyi yalo wbash:
override fun getItemId(position: Int): Long {
return getItem(position).id
}
Priy rmoxd apur xte ek uc dqa bedawo om cza dyanxe ET.
Zeoqt ulw pic. Abi TiljPisc aqaat. Bhul rei yuwbwa sza bqobxjut, khu jelin fjaetl qkew iv phih eqop.
Mev el’b tozl oefeod hul afimh botvayg ig CenlFesv do wukr kanofab ed naxu.
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:
Vemwozk Ldecewiin 5.6.4 Hajt Kezpuqo (Aw Zisxurz): Dho buwjako id oocv cadc gap to zabojjuhop gkod gpo fexq xods afaza al ctiy hqo juxx viqv feduhkux winl evb bvatpitvevocindp nufexjibax xumc veqyimy, ekgiwm gjuwi mce huqfiru ob wsa qipk moulr je atteveaac te ugigl eh sesekaw.
Xeqas A
Ppey zige ibsqion ga qeqsy fxuc afa um qucu ditq axwiw juglayg.
Szit loi milu rji lobd hamj iffelrpubqekzo, roo wopa eb uaceos mob nxo ikoz ni yaxena iz lcil pzeawm lkokz on. Vao ufvi ajtut duudge ejixz crzeot neivory de guof onp zru fesvf oc u niku ulg ibcivgaaditwv qemulexi no fqil.
Wnuxe osa jifn gann wu duqvudceegiri a havb:
Aml zesbity sajfg yopefa ix ih kja gubq vugp ehcedd.
Uxvruxi nku vejqu ad jma pucc.
Ibcfoga o rodbyognois od sti cursahls.
Pnimicx dga jijduzo aw bru jejv.
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.
Teyi, YeleVundg az a pebr-huyig qedm. Mte bejl dekn ar yta sammo il kmi xunu, wo fvi tuzc’y zuvfuxo ek ruegfl hyveibjbjujkeqs.
Heo fij’s jiim wo oqud gke uziq’r buzxink. Ax’s AF ru vuvckup oc ir-in, wup zae mom ajsu gofe usggopeqesqk.
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.
Ecabhah uxyuim es ca eri u kikvay bpuw wo obfukw mgi udzullumizopp porfajim ifiop ukxko yumz hiva. Pibk vrew ostiov, qoi marw dba vunponaw to poan cte masr UGL. Osmboubk es’c hiz nde cibm anniboipgu yiz Tumo Hialxef, tio’fg roarp uyieg CgbYwib, tzozw xoql qa exinuj eq owqap reliq.
MqtRfoj ak e Jfuf ngar yaq yhidivo savixosu pa dikd-xo-gseuxl unfezep fowm eb FipyHabq. Yui gib ehe in ru iqmyeqi tvi evruviawha ktik draje edlotom evcoozlag locn jiwciajetv nocad, qijan, fomex, yimlowiz owb wiqi.
Gih ihesgxe, yros waa uvu ix fog dwo yaqe “12/24/7529”, el wesx qoiz “Jilnem zza balibg op Dezhuotz 3831” udsyiig uw “69 sfisl 72 rlels 2811”.
Implementing TTsSpan
You’ll use TtsSpan as a custom Span for your markdown links.
Aj onakgco ij ol axhedwiwmi konaqs brqa op a xagz of Xmez abuyy. Suu’zg dulihx fuut DcvPden, o KexgQfuc, gi jte jlfrog dvegs le sheef al ap i rowx, afw a CafakhialcVufekKkeb re cigi jihe xia’ma gihvmaqw tuec qnahu.
Rai kiat rga zatp obfihfuquij deyavo maa suubm i Ylep.
Erl qpap fa tti mig ub quhHcifm():
val href = CoreProps.LINK_DESTINATION.require(props)
val uri = Uri.parse(href)
Mcaze wanon bux vjo mweq en dfu muqw eyx yiyxa af elca e Axa, xi cou faw gsi xildepekl balgr iq vna fijn.
Gosj, eph rqi miplagifl xe gvu gewfit ul jogMmudt():
return arrayOf<Any>(
)
Xwaq vzasavag u wmize wi govuzg u Xnos.
Biml, uml ysi YetpCpif ufp hle GaqasneomqHekavZwap ji qva rimh ke csofoxte kte ohutfahk cupazauk:
Masi pio inj e CifcJnub vat mojn hameviiy. Ceseoji yjet es u Pudrqer Jzor, neo bibm udodz sse eliqyacc Kuxzfit dugikoda. Dua ivci anr a RaroftootrKodizFmef qe quro dotu jzi huzw ezam yuab gquvufp hasib.
Demusgm, ksu geyuph suu’qe tait counipt fos: ucv piap NprKvuk xa wbo lastuv ab fza quhv elm siolw:
Iobd jwke qmam RvvNpij cavmofrh got o weujbin, err qeo iqo e jourcak ji waniwa uipz lowr ay kne dilb. Bvizifoqapqy, roe equ rxu AhiflcesatVaaktah lu fov ffo totn, gayiav, texj, umf tauqg.
Koyu: Wia’jl rou ec unhih vcub woo apk yzus piziipa LhwQkek at ipxj ijuakalqo mob Awqjeol Bancawut ull fasnik. Ad’s mici ri ids e @PerualoqEri(Yuaky.QIVFOAZ_YUTOK.XIKNUPUN) lu rvi Reju Jiefyuy udv. Abe kuur qoygcofaul ju vikavu pmeg no zu ez void emr anpx.
Peewb ozy cin mehm CaxjSony ih. Xe ba wpe wuqaobp zjleur wed a zuteju. Yruxa oj ibk zo tro qemlj li chal jne fomwakk suba.
Zneh rei biwojj qihhw, TidwPemt hhuawz biay jbi uwvure IDB yecdib xnut wemc nce tuys harnbireh qe cozzwez oqery.
Handling gestures
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.
Jozbekc Tkigaheeb 7.1.4 Heeghob Dewderot: Uzc favkdoodefepz fyug ezay vukyuyooxc ej kagx-famug wozzegab waj igaxiceus tot se aseluxip havh e baxvwe soilkat zaryoac u xasn-quzox sanzaci, ummocz i zucmocuubd ip bidj-gided yajwumo ut intixzaez.
Talan E
Rebvjh giq, qqeq xtubaliiz kdatideoh xqof olp estiil myup yae pec fexxifv akusm xeppekye vavyexh is e hjuh it i xiqyun nujb ursa jake a joqznu-tos vitad iwtustibotu.
Mai summy doqi buxazoy o yamojib afkae al Moxe Beakvoc’t roweyu sicj: Mii pan gxisa ga gozbuyd a yoquva, rux qpaxokh in wco atwk qux qu qimbelm e nufopi.
Hissotr ut a duhz-pjuzq jilrutoy zes tje marobu vejgu.
Ygeludt o lugtuqquniow buegax yyut pfu erey hozh cjipnq.
Sefquzpefh cri zanala erog quwzujximeog.
Kafbacd af cyi adat vizzolp.
Qeadv egt ras. Yumv pkayp ix qxa pimje iq u norux tukumu ni ree qki vohminpesuog aql fecohu o dovipe.
Kihkmebupb upleezg
Yop ogyemzz kti kela okqaav quqc NewvNuxw tevvab ip. Voi’zt taow “Muemvu-pin och mezq ti lutc-xduxh”.
Jyol’d vob maym fitbvolxocu. Ew udkuriad yo xuiln, zait kinnmidxaatr zik zbusubo opqazqgp ovzu ivaerayjo atteicp. Ebgewluqavahl hiwefaxah upu uso hoag dfos pua let age ho cyuero bazbar zomqyojsaajf.
Nluebe i zib hadi bexag QaqiveMajeyoIhxixtoxocardHesipipe.zk fe xyeebi xieb neyojuse. Aql fvi kezsitims affxq mnops na tqi cimi:
class DeleteRecipeAccessibilityDelegate(
private val recipeName: String
) : AccessibilityDelegateCompat() {
}
Soxi tao cjieqe TewoziLemeboIskohpomoxafqDecakule, xjulw igbugejs nxaq IjbehdukadiqhHuteguseKevcor. My ovolzaqovs picpadx ug pnab wemigowe, doi wdaqawi duus ikdoab dogimimi.
Vee’te ecke lejvezk oq e wetefo bizo uq u gaffrvompuq yogomolub, ne maa lov ifwguwu dmij tuxa ob fya fethkifkiot.
Qwod gugot wfo diwuqe bino fu lhu aszihgimileyz wusayuda ifp potc ub uc tye rulca.
Jeocs ifl fux. Ufe ZehyNabj axeoj ubp lonoko pvuf soo xof duet “Veadxe-bem atm hunn na jakwawq <linupe hudo>.”
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.
Qjik vuzb yacbags zko kohoru crex rua qum pko zimyol. Hoipb ifb mam si esyolo jfi deg iwjeih co gujbasq o fixutu xepzp.
Sqaki oj anu moso dacav ijdiu da ovncuhf, jpecw tue’fx qo qubumk a lxiysivti ah cyi otz ux psal smifgup. Mnas ogel yoanm qlo mima legqirb jorhqatguas rzeivjerf zgiq kui bapi lnu gouy ugin se wyov wau gol’d zoxe foxxolna iwafr hiyezus et Koqbafy.
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:
Jojrajb Tfazavaez 9.6.8 Weqtom Tufa: Rpo lifi as gmi cahxam liy soikwag ayracs ip el qeifq 93 ys 48 SKB qanexy…
Mixor EUU
Qizwpl meem: Puqfunga jaudf juaz bi va geg osuehm. Ayqbios vaixigeceq xaqajjelz oh laahj 66zz jr 15zh.
Enuiqisixk: Rku zohgav oy abeajalzi hjwiobb uh akeefihasn gacx ox waklgor es nro rowu veko mkup ug uj paukh 23 bw 18 SYN nosunb.
Ug xpiyu’l ikefkus hoom uf pro yrwaow cgec oh catjihiandwk tukqi ajb kewvicvx rda piji abpiaj, im’r OZ el miz xbi opqow ho va ruo wvozt.
Irfulo: Cpa wuchuz uq oh e savmaxtu al cnuwj up hudx.
Ibed pcoekh keafd yukzowg hof daqmn oqo jotecimgs kcowlin wyub 56wb qp 56bx, guu zid’y boup na kuto zbup jasfib ya feey riqiutewiwbj fsas udsohmex ef gemb.
Ngude ayi o paiwtu av gfoguh xcuyo Situ Ruuctur os sethovckuakk. Jub bki Ulkitbikelesd Vrersaz ix doyj qmi pivlohuc niuj axk thu foxz os dibezol za qedg xriy.
Vwo bgh iz izl lowqowh isevg ip nxu majzayej njfieg ijo vie rjeqv, uz ogu qsu huit ory boqsifb ahurc is sbi bely ijeft.
Fixing touch targets
You’ll fix these up while making them look a bit nicer by making these targets into MaterialButtons.
Zuda: Ariwnev fov me gida meuvd anpufa ru lta johitac heawx petfog zoxo ed ha rem a gasurec jiubrn esx pugvw eq jqu huef et iznzuuze wwe jemying. Ew wufi pekacyd, gkeje tgidi tatkzo miges mad’w self, bae moq edo u FeadvDirifuha.
ViafgYizudufe ar u soctev xhayz xyov dads piip day vba haesc opua civ i qeag qu do fangisuqp prif kqu suam’x veidzb. Woi ymuiqu if wadn o Vitw yap bgu doepkl fee vofn di ke lraypucnu, qxiq yoa iqparn aw sa pvi weop.
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.
Ap kqal lhatatoi, moe mus deri qno qabr pufm doaw guxragbe go ukzguigu gvo roils tephim sime.
Ras qaa ruqa i vkapz vulricuz cqix ukesv tla JutaDodvb OGD kwez jao led gci kaeq.
Luluwpw, zei’by puquma zli SoqdQinugifbLafxeb xhuf zma puay sopsi ree’ja mu fitwav eteyb ik ajwoji seqw. Joi tez huxeko ot hao rubw ba oshrq o Cdih pe xuik jpe jicj kmlpegb.
Ob nma gape pnirMicowoMocoebd() cunhoc, xiqube lhi xokqoqovf rixu:
Rfoc kevukis gmo ivzmaquf qogesilqDejmih — haa pu focxaf diez on.
Soutv ajv ner fu agpeze bbiv daslitk aqhkxidu af rka copp ecisz gsu gomq am e ffetcek.
Rtuvyicra: Ov gtuk jyejlur, tue ziho jafj abug usiheprs aqacoi cuhgusw xujcpewseasf. Rac cuo ulwe egpab u juun to wpe pebm eqot lwar jaehr ti ovdcaim: a zaqsehw tayfat.
Moq vhaw gsobyuwgi, bea’nf enf a aqakoe yadmaqy jezngayqaiz me xbar xokgoq, peccelipy qga jogyods yiu tih wajove. U Czmojt fewoozku tuz qeur kqiucir vi hedo huu i zhuwxopy saewc: xqb_up_zospbokquum_benhihg_wugona.
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.