package Ġio . nova foundation . nova . feature _ account _ impl . presentation . common . mixin . impl Ċ Ċ import Ġandroid . view . View Ċ import Ġandroidx . lifecycle . Lifecycle Owner Ċ import Ġio . nova foundation . nova . common . base . Base Fragment Ċ import Ġio . nova foundation . nova . common . base . Base ViewModel Ċ import Ġio . nova foundation . nova . common . utils . on TextChanged Ċ import Ġio . nova foundation . nova . common . utils . setVisible Ċ import Ġio . nova foundation . nova . common . view . Input Field Ċ import Ġio . nova foundation . nova . feature _ account _ impl . presentation . common . mixin . api . AccountName Chooser Mixin Ċ import Ġio . nova foundation . nova . feature _ account _ impl . presentation . common . mixin . api . With AccountName Chooser Mixin Ċ Ċ fun Ġ< V > ĠBase Fragment < V >. setup AccountName Chooser Ui ( ĊĠĠĠ ĠviewModel : ĠV , ĊĠĠĠ Ġui : ĠInput Field , ĊĠĠĠ Ġadditional Views To Control Visibility : ĠList < View > Ġ= Ġempty List (), Ċ ) Ġwhere ĠV Ġ: ĠBase ViewModel , ĠV Ġ: ĠWith AccountName Chooser Mixin Ġ{ ĊĠĠĠ Ġsetup AccountName Chooser Ui ( viewModel , Ġui , Ġview Lifecycle Owner , Ġadditional Views To Control Visibility ) Ċ } Ċ Ċ fun Ġsetup AccountName Chooser Ui ( ĊĠĠĠ ĠviewModel : ĠWith AccountName Chooser Mixin , ĊĠĠĠ Ġui : ĠInput Field , ĊĠĠĠ Ġowner : ĠLifecycle Owner , ĊĠĠĠ Ġadditional Views To Control Visibility : ĠList < View > Ġ= Ġempty List (), Ċ ) Ġ{ ĊĠĠĠ Ġui . content . on TextChanged Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel . account Name Chooser . name Changed ( it ) ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠviewModel . account Name Chooser . name State . observe ( owner ) Ġ{ Ġstate Ġ-> ĊĠĠĠĠĠĠĠ Ġval Ġis Visible Ġ= Ġstate Ġis ĠAccount Name Chooser Mixin . State . Input ĊĊĠĠĠĠĠĠĠ Ġui . setVisible ( isVisible ) ĊĠĠĠĠĠĠĠ Ġadditional Views To Control Visibility . forEach Ġ{ Ġit . setVisible ( isVisible ) Ġ} ĊĊĠĠĠĠĠĠĠ Ġif Ġ( state Ġis ĠAccount Name Chooser Mixin . State . Input ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( state . value Ġ!= Ġui . content . text . toString ()) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġui . content . setText ( state . value ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ