package Ġorg . ny pl . simpl ified . listeners . api Ċ Ċ import Ġandroidx . activity . Component Activity Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġandroidx . lifecycle . ViewModel Provider Ċ import Ġandroidx . lifecycle . ViewModel Store Owner Ċ Ċ inline Ġfun Ġ< re ified ĠE Ġ: ĠAny , ĠS Ġ: ĠAny > ĠComponent Activity . listener Repositories ( ĊĠ ĠviewModel Store Owner : ĠViewModel Store Owner Ġ= Ġthis Ċ ): ĠLazy < Listener Repository < E , ĠS >> Ġ= ĠListener Repository Lazy ( viewModel Store Owner ) Ċ Ċ inline Ġfun Ġ< re ified ĠE Ġ: ĠAny , ĠS Ġ: ĠAny > ĠFragment . listener Repositories ( ĊĠ ĠviewModel Store Owner : ĠViewModel Store Owner Ġ= Ġthis Ċ ): ĠLazy < Listener Repository < E , ĠS >> Ġ= ĠListener Repository Lazy ( viewModel Store Owner ) Ċ Ċ class ĠListener Repository Lazy < E Ġ: ĠAny , ĠS Ġ: ĠAny >( ĊĠ Ġprivate Ġval ĠviewModel Store Owner : ĠViewModel Store Owner , Ċ ) Ġ: ĠLazy < Listener Repository < E , ĠS >> Ġ{ ĊĊĠ Ġprivate Ġlateinit Ġvar Ġcached : ĠListener Repository < E , ĠS > ĊĊĠ Ġoverride Ġval Ġvalue : ĠListener Repository < E , ĠS > ĊĠĠĠ Ġget () Ġ= ĊĠĠĠĠĠ Ġif Ġ( this :: cached . isInitialized ) Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . cached ĊĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠ Ġ@ Suppress (" UN CHECK ED _ CAST ") ĊĠĠĠĠĠĠĠ Ġthis . cached Ġ= ĊĠĠĠĠĠĠĠĠĠ ĠViewModel Provider ( viewModel Store Owner ). get ( Listener Repository :: class . java ) ĊĠĠĠĠĠĠĠĠĠ Ġas ĠListener Repository < E , ĠS > ĊĊĠĠĠĠĠĠĠ Ġthis . cached ĊĠĠĠĠĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġis Initialized (): ĠBoolean Ġ= ĊĠĠĠ Ġthis :: cached . isInitialized Ċ } Ċ