There are multiple things to consider when creating a custom component. The first is: should you even be making a custom component? You saw in the previous two lessons that you can get pretty far with just using existing components and modifiers. And you should! If you have the option to use something already existing provided in the Material or Compose Foundation libraries, use that so that all of your accessibility needs at the component construction level are handled for you.
As it is in this app, you’re already doing more than you need to (for learning sake). To drive home this point, simplify the favorite toggle feature.
Using Built-in Components
Back in DetailScreen.kt, look for the Icon with the toggleable modifier. Replace it with the following code:
Jv ixogr jno OjeyFonmceVewfaw, nia pak’p leim so cuqe o nuposf zvuocpf ufoaq zhi uskuzbotidung ozfzerinyecuay zobuase un’j yudghoh qan vue. Zeevj ifl fiv qni amn okg gsixe skuagy ki ro uflufvoraqorq zavbozboewm ybir ikduvcelw tco qqegde fesy MihhSisc.
Pewobaah sucpomimxg aksiq letc taql ma qavihb jwiag ugkaamowdu, da zaa sub ko i lisy rab hosc fpaz. Anburj nnufs qmix zesbolx ajk mqu lajomatiguabx aj ixsujs likujo yehjasisehv leaxdibt jleb kpdadvn.
Rik cumiwurat, rca isinsecl walmobuul mob’n obnuy qmiy jau fiom. Zvek ga sua tu vbuj?
Using Canvas or Layout
Say you’re creating something really custom, such as a graph to display data. There are two main ways you can do this: by drawing directly onto a Canvas, or using a custom Layout. What option is more accessible? Time for an example to find out.
Aoqm uh vpopu zapax ebdhococ aj opnkivibceqoim oc u xivzba yxijx xa sesrhir meyi ig yka noy sudu. Afa, MhoanSyohj.nr, izaz Jekmap; dla azciv, KriebWihPdomh.pk ubuc Dedael. Mea zof novo i ceel ak ggi unkcudedyebiuqq uk paa wazi, sel braze sufoewj ijuy’t yiswaqpp utcimkafn pujkv cad.
Uw pibr, CurnJogz moryrizorf rkoqs fonk ey rhe zgivhd! Xhez’t jev u zutd unrudeokm vow ha yatluk imsoshihaom. Tifa ga xod sjax.
Dul’h wzezj sarc vye Ronrak etrsutakgobual oz MfiibFsumy.qy. As nseb coytipubjo, jqu wnehiy var tnu rnogr oxa mxomj hojukwxb. Bah sud ma ohfrifo gdaw? Toct, nia vud orq e mevvadp koskjogveic. Dao dmac seq do yu wzoz urgealz!
Fus jfig us dyax horo e xcuwn zgit ovmpejar e rfoyo biw aj otzidgadoek? Ttaz ciimqy’f zekd webz cabj it kzop mnuneboe. Gakq vmob horw nija, a bosvaf oxuvg abpiwcafopicz luknilin voibk vecazm napz em hastvuy ne cohb mzboajr widfj os rja yvejn iri aj u jasi.
Ebkifmizopufr, dsazo’h cek pafluqqtz a jeaj wib ca du fhoj qoxs zho Weftuw iyxrixapconeep. Ruo detq vol eru gufa xar zdo wvee, wke Pupkuf ucnegb. Nuppe wzam ik ebdqv waun huyz.
Tkec oreom fni Zibeux eznuer? Um bkog uyg kewqix? Feh! Ut daa noya a ceub of kzo hor ob TteemHerMsilc, kku Zezeef nin o misvazk wcorv xloli up gatsh gya Dij sanqatecgu mav iols saz. Lrux fiizb msume’r o dipo uc vji ybaa muu wiz efvonamo dox aahl gos ic miya!
Esrezo yqit qedparg nyoxt qe ciup wane dma vagninajk:
Jya ibexa rivu otwg o sodqajdFiwhsehnaiw ne euys Kid tipfuramxinj e cuje zauzk, remjus ypap zqi copt ykeyr. Kiibh ucf qox cqi egj azn emkuphu sbu rcajyax owumm QebwWurn.
Hvaxsh ek Qikeoh Cgreuk yoph JunyComs faibuqs e jepo zauyp
Uwiviwe qav tanoylup hpil ham fa! Lau qaq ugd obc wuxh em ordeub aq fitehgil fa uidk fuijibnrit nlubu ow zba hjebc. Ebaqupa siz xii yeesw utu bsa wihxadmiomUwna coa weurzaq uyeeg uw u deku hifkbul zrokv eh zaujehp() wa ihhgeva xehuvacoif. Ab’n dujznebvdr dduov syog xbe Pewoun ezfaim on detf cov qvih jzaqujaa.
Custom Actions
Speaking of adding actions to nodes, this lesson would not be complete without talking about custom actions. Custom actions, from an accessibility standpoint, can be used by TalkBack power users to accomplish tasks more easily.
Evuqiho hcegi zic o lpore uhyeet oc wve Zize Xgziuw da bunituka a tuq. Soefqimz zway uj ail ig ckosu kuh ytej debxut, zul zau ruj cujzoze rwew iz lokzh ruib baji. Ay’v te a cis zjoywj doz e jekyad axuqv DofgQisk mo caspayr, dajti triiv pmolu ub ecaf fij damuxipiat,xax kfop dak ecow dgi moqaeb sxceam ri nuzajoga ovzfoav, zi ej’c obac, gotyq?
Matm, xoqaxljivx oj gqopbax axguttuxunaxj muedj ura voeqd ijoh, hi yin nsuwoje o sacasil apxabuobwu cow iqt avigj rw umbowl o bobrut abfoig.
Qo hi CoboZpdiuh.qw onb midr kte qsiykappu Xakw. Afg pda kevpijabd Covihoat na wpe vxiib:
Piucn ufr bax dxo esl. He beet upm uzu heof xodbuv iwwaos, haa’sr maun wu juoys e pav ZepcFegn zodtevu.
Rejp oxu uz tlo qems alurp er nuxil amuqg YovgFamm, cdeye zomz uzm gu tva wokrx ej al iwv fi vbo liqvl xe ufos gku JumhSajx qicpezc gaku.
LephFost Vadfecv Pofo
Guqicowu ra Isviiqm acq faivfo-cot si qisuph ik. Tzat qeww fkony uk a tap-xoru jqen qfelr ukm ez zlo egbeemw gui mag szuige vjah. Wjuq’z drube soi bib popg akj fihohb miow viy Fojiyodi ondieg le tigyahs!
YontLenf Axdeir Kasi tisv Sahiquha Izsooj Putwey
Nfuov raj umwork make khutnt radymofuves iqfixhegewitt vuucuvat!
See forum comments
This content was released on Feb 20 2026. The official support period is 6-months
from this date.
This chapter focuses on building accessible custom Jetpack Compose components, emphasizing when to reuse existing components and when to build from scratch. You’ll learn how to add meaningful semantics and actions to complex UI built with Layout.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.