/* Ċ Ġ* ĠCopyright Ġ 2 0 1 7 ĠSquare ĠInc . Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ package Ġcom . squareup . sample . auth workflow Ċ Ċ import Ġandroid . view . View Ċ import Ġandroid . widget . Button Ċ import Ġandroid . widget . EditText Ċ import Ġandroid . widget . TextView Ċ import Ġandroidx . appcompat . widget . Toolbar Ċ import Ġcom . squareup . sample . t ict act oe . R Ċ import Ġcom . squareup . workflow . ui . Layout Runner Ċ import Ġcom . squareup . workflow . ui . Layout Runner . Companion . bind Ċ import Ġcom . squareup . workflow . ui . View Factory Ċ import Ġcom . squareup . workflow . ui . View Environment Ċ import Ġcom . squareup . workflow . ui . back Pressed Handler Ċ Ċ internal Ġclass ĠSecond Factor Layout Runner ( ĊĠ Ġprivate Ġval Ġview : ĠView Ċ ) Ġ: ĠLayout Runner < Second Factor Screen > Ġ{ ĊĠ Ġprivate Ġval Ġtoolbar : ĠToolbar Ġ= Ġview . findViewById ( R . id . second _ factor _ toolbar ) ĊĠ Ġprivate Ġval Ġerror : ĠTextView Ġ= Ġview . findViewById ( R . id . second _ factor _ error _ message ) ĊĠ Ġprivate Ġval Ġsecond Factor : ĠEditText Ġ= Ġview . findViewById ( R . id . second _ factor ) ĊĠ Ġprivate Ġval Ġbutton : ĠButton Ġ= Ġview . findViewById ( R . id . second _ factor _ submit _ button ) ĊĊĠ Ġoverride Ġfun Ġshow Rendering ( ĊĠĠĠ Ġrendering : ĠSecond Factor Screen , ĊĠĠĠ Ġview Environment : ĠView Environment ĊĠ Ġ) Ġ{ ĊĠĠĠ Ġview . back Pressed Handler Ġ= Ġ{ Ġrendering . on Cancel () Ġ} ĊĠĠĠ Ġtoolbar . set Navigation OnClickListener Ġ{ Ġrendering . on Cancel () Ġ} ĊĊĠĠĠ Ġerror . text Ġ= Ġrendering . errorMessage ĊĊĠĠĠ Ġbutton . setOnClickListener Ġ{ ĊĠĠĠĠĠ Ġrendering . on Submit ( second Factor . text . toString ()) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġcompanion Ġobject Ġ: ĠView Factory < Second Factor Screen > Ġby Ġbind ( ĊĠĠĠĠĠ ĠR . layout . second _ factor _ layout , Ġ:: Second Factor Layout Runner ĊĠ Ġ) Ċ } Ċ