package Ġcom . she ve lev . my _ foot prints _ re master ed . ui . activity _ main . fragment _ set _ location . view _ model Ċ Ċ import Ġandroid . content . Context Ċ import Ġcom . she ve lev . my _ foot prints _ re master ed . R Ċ import Ġcom . she ve lev . my _ foot prints _ re master ed . ui . activity _ main . fragment _ set _ location . model . Set Location Fragment Model Ċ import Ġcom . she ve lev . my _ foot prints _ re master ed . ui . activity _ main . fragment _ set _ location . view . Buttons Binding Call Ċ import Ġcom . she ve lev . my _ foot prints _ re master ed . ui . shared . mv vm . view _ model . ViewModel Base Ċ import Ġcom . she ve lev . my _ foot prints _ re master ed . ui . shared . widgets . screen _ header . Screen Header Binding Call Ċ import Ġcom . she ve lev . my _ foot prints _ re master ed . ui . view _ commands .* Ċ import Ġcom . she ve lev . my _ foot prints _ re master ed . utils . coroutines . Dispatch ers Provider Ċ import Ġkotlinx . coroutines . launch Ċ import Ġtim ber . log . Tim ber Ċ import Ġjava . lang . Exception Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠSet Location Fragment ViewModel Ċ @ Inject Ċ constructor ( ĊĠĠĠ Ġapp Context : ĠContext , ĊĠĠĠ Ġdispatch ers Provider : ĠDispatch ers Provider , ĊĠĠĠ Ġmodel : ĠSet Location Fragment Model Ċ ) Ġ: ĠViewModel Base < Set Location Fragment Model >( dispatch ers Provider , Ġmodel ), ĊĠĠĠ ĠScreen Header Binding Call , ĊĠĠĠ ĠButtons Binding Call Ġ{ ĊĊĠĠĠ Ġval Ġtitle Ġ= Ġapp Context . getString ( R . string . setLocation ) ĊĊĠĠĠ Ġval Ġsave Enabled Ġ= Ġmodel . can Save ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġsend Command ( if ( model . is Google Play Services Available ) ĠAdd Map Fragment Ġelse ĠAdd Stub Fragment ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Back Click () Ġ= Ġsend Command ( Move Back ) ĊĊĠĠĠ Ġoverride Ġfun Ġon Save Click () Ġ{ ĊĠĠĠĠĠĠĠ Ġlaunch Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmodel . save () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġif ( model . isIn Update Mode ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsend Command ( Move Back From Set Location To Pager ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsend Command ( Move Back From Set Location To Title ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} Ġcatch Ġ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠTim ber . e ( ex ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsend Command ( Show Message Res ( R . string . save Footprint Error )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }