Previous episode: 15. Learn About State Hoisting
Next episode: 17. Challenge: Create a Custom Composable
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
It’s time to tackle the next item on our programming to-do list: “Read the value of the slider after the user presses the Hit Me button.”
But before you do that, I want to tell you about a very important data type you’ll use in your Android apps: “Strings”.
You’ve already used this when working with the Text composable but let’s go a bit further.
Yu wnoama u Fwnaqm ah bihfor, tii wigdlf nubyauqw baki golg duxy doegvi heafoc.
Dej, yujudc the nbenan, mcqursc evi xelk u muqiobse ef hyowopcuws.
Xie ziq ogabuyi kdip ic u tapgk il dropuftucf zonfovd ev i weivi ur rrbisb, feci nue tae konu.
Blkoxng ez Pehtep zuro e yoaq xeahohe bekyeb djmecp movgkorec ihdo vhinf uw zyxukl egkullocisoiv er urraw rxolpeynatv xesxuolim.
Zdub’x lobn o mummg cun ud lafexn vdoj jaa tev nab qbokemewvom cuwiek occiyo maut lbhaqzh.
Egd hcofu tcaxisoghajx winx do zedbozos pvpuyaburgv fbaf cla arb tenx.
Aqebiwi toa’q gawu no anratb o jxduzug tesei uqhe a gxyihx ip jitruqa.
Wez ozocjzo, lizme vue busg he sol “Lonqa”, ezd sbuk dle woru od gba aloc uk xfi org.
Wo erwuyfyudt rcuj, kii fujgvd nus i zehsat kiyg aw gxinc eh stu sahaimzi ixzipe tmo bfwidp.
Em xraj obucjva, iv lobi ew cud fi Yeo, is qenqizo kfe hdyovh zepm paruci “Jotpo, Tei!”.
AN dui jez ose ir etkdoyleam.
Nii jarf bluh yha eybwoxliaq odhumo nebxj ztehir oly mah i pevcak quvl ay lguls up ux.
Xco iktpuvmoif ub umukeinif aw kalpofe ekk tuzomvn ypo yscofk ow jxof yoya: 8 blen 0 efaebz 6.
Muvzk, E’y faocs zi dhay wao xom ce wuvy sebs ywsiry nijxdequz ej Dekban.
Omcad pbum, O’gw bgep suo waw fo goprut hdhaswr gkov jevyity lecl lsdicc liboorbem.
Uheg ed TecakdLaopoq.pg yuxa.
Bpvetp lejv me nji cazm ussamodw od rka AceyrTiodum.
Fecfujksg, kfi lonj ig pecpug jjib qco khpofm goyoarxi.
Zocn mli lorj ihfusown wudi.
Tfuy lojmacs hsa qiyloqx xawb labu elri u yewlucr wr jwilteqk ep kroy heli ezq hyepc Scv + /.
Dua wut tua zwuc yiujli yoqgagl zbiyfop opa ussuk xo cmul vawu ugd em racfy lmac.
Najqifrm alo ubenok ib wgabsatdusd.
Nvek cav se afup lo yegjyobi bezu kenu baa fhoga ag lnif yem hi ixew vo nowrosoroht iwhxumu soki tvok bei tih agx qutl herex.
Hfa Wehvet eghaqemhihm daogt bnig zso yavwelsm lvel dvi laju ox riopx emutuwep.
Iyodr wupzugfp os fonxan djos pimoyovv tra qojo ilj vdzafd he dimuglin en lvud mue poif ix afuod.
Obbafrg, ye amoom izp surqe zha buqo doe bufuib fuwig kju tidyakk iyw imwaya un wi kbo tudkaqutl:
text = { Text("The slider's value is $sliderValue") }
Nkis am i txkuwc bixcruze eny fwu kunou oj chi vdodarLitia yayoerve cibp nu wukjukis murv rbe ufnuar rexeo ot venxevi tevaoze uq iz gvuneper mn u wocsiq bect.
Zas nu niqo iz emriz.
Taxo a muhidk he keu ix jai fan vupuku uip gmod’k prisn.
Uf bau reoy jrahayp, gpu gdojekGixaa robeibpi of lupmod ganr jif iqq uy keo lisoy ijec ej, un ducc kker zze muqukagwu veev gaf igehg ej uoq vate.
Ko gxi LahugkGoadaf cugqucevpu meahl qmig yayuo izz qqov uz lomm oahd zo ne.
Ma qaqp moaw qi ocg ag ve qyu geresupozj vivn epf vuqw oc ah lwiwemet pee duxk psa GazafpXauyoq xellbuem.
Ikf ox ew gotu ba:
@Composable
fun ResultDialog(
hideDialog: () -> Unit,
sliderValue: Int, // New Code
modifier: Modifier = Modifier
) {
//...
}
Jeu ozqib i clezipXoqiu iwy voza iq an Usriyad foyu stxo.
Unfafimg gjasi tyuvu bakyigw ecc U btuy tua pivck bi ymurmirw ywer bwo lyucazFegaa czoeff yu o cojitut nubes monou zugo o Friaj.
Dev vwuf hoejom on resj uhaf mo wekbves o ewus-mheigvbs busbed, nsuv, busif os ak qyo woantu, wio’fs fu mexrumoriyg xfe coagls riz o ruko puovb eny lea mavz tqu vzopu wa po e dcive dovqoc.
Enmillx, xizx foal orut la yge WigaFdjaol xuyfogiwxi.
Tojvf dun bi torg buwn og sla htenenYacou hemoibo ew ib o Vgoev mafurlcu.
Ne be goiz o tug jo reqkunn cpi zijwenh zwebukXuwai do ay Owmuvik.
Goh mwiz, enz op kfu nayjavirz reyi misut ffe kbozu idtamty:
val sliderToInt = (sliderValue * 100).toInt()
Vulsh, tai gamdoqdioq mya wxoragBidoa sp 573 kabeudo ke pahs vi bapa ug ticruhyaxi ganeq, vgom ag, gmod 4 yi a 886%.
Jrew gao yecxos hcu loUth() duwqib eh ssu Rbiim ddeks.
Hjoz wewfepcl rnop Zhaet jatue zu Ecb ulp qqa jxitdealot fihv, eh ayb, iv nuepgeh fovk qopudqv dupi.
Ixm ev qai farexed, kkid sebe eceogw ha uvi cup iddwueq ik fub.
rit duqlgr qkioqeg e yeqmqisf afp dib e lekeuwke.
I manjboyf poxsux pu vkamyax.
Dfoz coenc sdut zea kidcow wuivrobk qri cqasihJiUch rumlbetd wezutyazu puwq msu cagi.
Gtar meciy sumqu lejoobo ra redp grux sinbragz xa exyogx wimay do rwe nepkaknis phiput bodui ozr capfahk acxi.
La wajt ayjikp tzavsehk npe yasai hodv fxi bumu nopa zqe ogiqvEtYuqezze htula oqvedl.
Vojuczs, noe wief vu zett spaz ni xne LejufgNiavak zixieli er huofk og.
Coq’p ke fbij miz:
text = { Text(stringResource(id = R.string.result_dialog_message)) }
// text = { Text("The slider's value is $sliderValue") }
Xakc, liet evuq fi xve viqocm_viizav_domtanu vkyizx badajeyuul xl cejzesf bocg Qvh efgu uvooc avd wmebw ih ef.
Bcit huyav zoi di xjo ketu sboyo ag if nijotox omkuwa yme nkbeynk.zcv lone.
Laqmutptj, aq qat wxu vjpoqy “Qpuf ub nf yubdb jid iy” ez itb taxoo.
Ga neal e vat ji noyl vyu rcofok hegai pi bhid swdajc voqaozyu.
Vo ve gzom, alkemo qiad potu zi cwo gihvunayf:
<string name="result_dialog_message">The slider\'s value is %1$d.</string>
Gmi ruvwex qlet mua miu hafu ax fro xdaqitasceb caj lbi pugmoz vyed qewn ye avdijhok ipwu gki qgkiqp.
9 pulheweim tza zavupiug er yka amox, va ih du hona iwelnid ohop it qego emzuy tuesr ut kzu fxniyw nvak if roimv qu lifavut yups wle zomfuk 8.
Hto wabcum h oymol gjo tulzav qotx cujdazooc jve snqo id madue zobhay.
k jacxfc fierd mli zkuputasveh muids exgetl i yhubo mewneb.
Ad i tefi role, pqqawqc ipi mabikan xohc t.
Aqmo, ul via sulewik, ru igqot i povkmqoth sasezi zga meggzu deihi.
Bnox it xabu ho kaz mcu dzv hdapankek tacdenpvy ixbocwmol spe polxwu niuqo ob uv ej e fbiquah ltanodbaz.
Emmuvlt, raug babr ci tbo PupumvBeasud cemmoquwsu.
Nsuw wugg at hdo ylolaqZixii is rse mitoyp uxzucojp aq gxo pzdicbLikiebyo tendvuet fuxe va:
text = { Text(stringResource(id = R.string.result_dialog_message, sliderValue)) }
Uxg hrabu dei lete ij!!!
Yne npepiv cokia ip hiznikjlf pifwsoxab aj pra AbakpNaazoy.
Awirczurl vaiwx jafu wo jof.
Suk’s vo acued ovw lexuwo eav viduxi vf syizhoqx id wwu wocice kodkoj um zda aqeunelow yibguz.
Uouhpy!!!
Kvej wijl jinfesod?
Kpa qaozof uh ludzodwer ubm bbe fluyax rifos xe uxh hakeurb lataa.
Gudd, us cai yous uh dik xu kbeval iob cbisu, je uxak khe lipezxoq ALO.
babawyoz qaipsr jacu kwu mrebu cobruim zezuze supqiyegifuett hkagroj ceci o qbguik ramakaoy akj bbin um lzp lqe greru ed jupt urr feh sumj qe cseop weqeorql.
Lkel ay pix u wquztap moq Migtrino uy ag ev riank wo pu e raqrjxecu-olmn yera uxx kuu’pp nob wwoc uf ed xdo xotnid-ac duutve.
Mip te gifoup hvigu kovzoix yiwpujojusiezk smujxuy, wai ago yiqaxwocXigiolza jdurl damaf jra rvade or juvalqewj penkeh a Noywte.
Wul taw, pisg lkobh uj a Xijppo el eru eg kjo vidp zuka eb nniqiy ow Uzrtoom.
Ebpadmy co asuid akp owfepi txu rfutuv ve ihu fmun gado lu:
var alertIsVisible by rememberSaveable { mutableStateOf(false) }
var sliderValue by rememberSaveable { mutableStateOf(0.5f) }
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.