package Ġcom . ste phen b ain . re listen . artist . ui Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . View Ċ import Ġandroidx . navigation . fragment . nav Args Ċ import Ġcom . ste phen b ain . re listen . R Ċ import Ġcom . ste phen b ain . re listen . common . observe Ċ import Ġcom . ste phen b ain . re listen . common . ui . Base Fragment Ċ import Ġkotlinx . android . synt hetic . main . fragment _ artist .* Ċ Ċ class ĠArtist Detail Fragment Ġ: ĠBase Fragment () Ġ{ ĊĊĠĠĠ Ġoverride Ġval Ġlayout Id : ĠInt ĊĠĠĠĠĠĠĠ Ġget () Ġ= ĠR . layout . fragment _ artist ĊĊĠĠĠ Ġprivate Ġval ĠviewModel Ġby Ġget ViewModel < Artist ViewModel >() ĊĠĠĠ Ġprivate Ġval Ġargs Ġby Ġnav Args < Artist Detail Fragment Args >() ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĠĠĠĠĠĠĠ ĠviewModel . load Artist ( args . artist ) ĊĠĠĠĠĠĠĠ ĠviewModel . state . observe ( this ) Ġ{ Ġstate Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwhen Ġ( state ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠArtist ViewModel . Artist State . Success Ġ-> Ġtext . text Ġ= Ġstate . artist . name ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ