package Ġcom . zig is . p ale onto log as . periods . fragments Ċ Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . ViewGroup Ċ import Ġcom . ever note . android . state . State Ċ import Ġcom . zig is . p ale onto log as . application . android . Base ViewModel Fragment Ċ import Ġcom . zig is . p ale onto log as . periods . data . entities . Life Form Ċ import Ġcom . zig is . p ale onto log as . periods . view models . Period ViewModel Ċ import Ġcom . zig is . p ale onto log as . periods . views . Period View Ċ import Ġcom . zig is . p ale onto log as . periods . views . Period View Delegate Ċ Ċ class ĠPeriod Fragment Ġ: ĠBase ViewModel Fragment < Period ViewModel , ĠPeriod View >(), ĠPeriod View Delegate Ġ{ ĊĊĠĠĠ Ġ@ State Ġvar Ġperiod Id Ġ= Ġ 0 ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( in flater : ĠLayoutInflater , Ġcontainer : ĠViewGroup ?): ĠPeriod View Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠPeriod View ( in flater . context ). also Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . delegate Ġ= Ġthis ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . on Back Ġ= Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġactivity ?. on Back Pressed () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Attached () Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel . load Period ( period Id ) ĊĠĠĠĠĠĠĠ ĠviewModel . load Life Forms ( period Id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġobserve Changes () Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel . period . observe ( view Lifecycle Owner ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontent View . configure With ( it ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ ĠviewModel . life Forms . observe ( view Lifecycle Owner ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontent View . set Life Forms ( it ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// Ġ ĠPeriod View Delegate ĊĊĠĠĠ Ġoverride Ġfun Ġopen Life Form ( life Form : ĠLife Form ) Ġ{ ĊĠĠĠĠĠĠĠ Ġglobal Router . push Fragment ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLife Form Fragment (). also Ġ{ Ġit . life Form Id Ġ= Ġlife Form . id Ġ} ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} Ċ }