package Ġio . github . well ing ton cost a . android work dev talk . app . contact registration Ċ Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġio . github . well ing ton cost a . android work dev talk . domain . Contact Ċ import Ġio . github . well ing ton cost a . android work dev talk . domain . Contact Repository Ċ Ċ class ĠContact Registration ViewModel ( ĊĠĠĠ Ġprivate Ġval Ġrepository : ĠContact Repository Ċ ) Ġ: ĠViewModel () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġ_ saving Ġ= ĠMutable LiveData < Boolean >() ĊĊĠĠĠ Ġval Ġsaving Ġ= Ġ_ saving Ġas ĠLive Data < Boolean > ĊĊĠĠĠ Ġfun Ġsave ( contact : ĠContact ) Ġ{ ĊĠĠĠĠĠĠĠ Ġ_ saving . value Ġ= Ġtrue ĊĠĠĠĠĠĠĠ Ġrepository . insert ( contact ) ĊĠĠĠĠĠĠĠ Ġ_ saving . value Ġ= Ġfalse ĊĠĠĠ Ġ} Ċ Ċ }