package Ġcom . ap top ay ments . sdk . features . input data . phone Ċ Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġcom . ap top ay ments . sdk . features . analytics . Event Ċ import Ġcom . ap top ay ments . mobile . data . PhoneNumber Ċ import Ġcom . ap top ay ments . mobile . data . user . Phone DataPoint Ċ import Ġcom . ap top ay ments . sdk . core . platform . Base ViewModel Ċ import Ġcom . ap top ay ments . sdk . features . analytics . Analytics Service Contract Ċ import Ġcom . ap top ay ments . sdk . utils . Live Event Ċ import Ġcom . google . i 1 8 n . phon en umbers . PhoneNumber Util Ċ Ċ internal Ġclass ĠCollect User Phone ViewModel ( private Ġval Ġanalytics Manager : ĠAnalytics Service Contract ) Ġ: ĠBase ViewModel () Ġ{ ĊĊĠĠĠ Ġprivate Ġvar ĠphoneNumber Ġ= Ġ"" ĊĠĠĠ Ġprivate Ġvar Ġcountry Code Ġ= Ġ"" ĊĠĠĠ Ġprivate Ġval Ġ_ continue Enabled Ġ= ĠMutable LiveData ( false ) ĊĠĠĠ Ġval Ġcontinue Enabled Ġ= Ġ_ continue Enabled Ġas ĠLive Data < Boolean > ĊĠĠĠ Ġval Ġcontinue Pressed Ġ= ĠLive Event < Phone DataPoint >() ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġanalytics Manager . track ( Event . Workflow User Phone ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġon Continue Clicked () Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Loading () ĊĠĠĠĠĠĠĠ Ġval Ġparsed PhoneNumber Ġ= ĠPhone Number Util . getInstance (). parse ( phoneNumber , Ġcountry Code ) ĊĠĠĠĠĠĠĠ Ġval ĠphoneNumber Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPhone Number ( parsed PhoneNumber . country Code . toString (), Ġparsed PhoneNumber . national Number . toString ()) ĊĠĠĠĠĠĠĠ Ġcontinue Pressed . post Value ( Phone DataPoint ( phoneNumber )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġon Phone Changed ( phoneNumber : ĠString , Ġvalid : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . phoneNumber Ġ= ĠphoneNumber ĊĠĠĠĠĠĠĠ Ġ_ continue Enabled . value Ġ= Ġvalid ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġon Country Changed ( country Code : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . country Code Ġ= Ġcountry Code ĊĠĠĠ Ġ} Ċ } Ċ