package Ġcom . pod cre ep . app . podcast s . podcast Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . widget . Frame Layout Ċ import Ġandroidx . lifecycle . Lifecycle Owner Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . lifecycle . Mediator LiveData Ċ import Ġandroidx . lifecycle . Observer Ċ import Ġcom . pod cre ep . App Ċ import Ġcom . pod cre ep . R Ċ import Ġcom . pod cre ep . app . podcast s . episode . Base Episode List Layout Ċ import Ġcom . pod cre ep . concurrency . Task Runner Ċ import Ġcom . pod cre ep . databinding . Pod cast Details Binding Ċ import Ġcom . pod cre ep . model . store . Episode Ċ import Ġcom . pod cre ep . model . store . Pod cast Ċ import Ġcom . pod cre ep . model . store . Subscription Ċ Ċ class ĠPod cast Details Layout ( ĊĠĠĠ Ġcontext : ĠContext , ĊĠĠĠ Ġlifecycle Owner : ĠLifecycle Owner , ĊĠĠĠ Ġpod cast : ĠLive Data < Pod cast >, ĊĠĠĠ Ġepisode s : ĠLive Data < List < Episode >>, ĊĠĠĠ Ġtask Runner : ĠTask Runner , ĊĠĠĠ Ġprivate Ġval Ġcallbacks : ĠCallback s ) ĊĠ Ġ: ĠFrame Layout ( context ) Ġ{ ĊĊĠ Ġval Ġbinding : ĠPod cast Details Binding ĊĠ Ġprivate Ġval Ġepisode List Layout : ĠEp isode List Layout ĊĊĠ Ġinterface ĠCallback s : ĠBase Episode List Layout . Callbacks Ġ{ ĊĠ Ġ} ĊĊĠ Ġinit Ġ{ ĊĠĠĠ Ġval Ġinflater Ġ= ĠLayoutInflater . from ( context ) ĊĠĠĠ Ġbinding Ġ= ĠPod cast Details Binding . inflate ( in flater , Ġthis , Ġtrue ) ĊĊĠĠĠ Ġval Ġsubscriptions LiveData Ġ= ĠMed iator LiveData < List < Subscription >>() ĊĠĠĠ Ġsubscriptions LiveData . add Source ( podcast ) Ġ{ ĊĠĠĠĠĠĠĠ Ġp Ġ-> Ġrun Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġsub Ġ= ĠSubscription ( p . id ) ĊĠĠĠĠĠĠĠ Ġsub . podcast . value Ġ= Ġp ĊĠĠĠĠĠĠĠ Ġval Ġsubscriptions Ġ= ĠArrayList < Subscription >() ĊĠĠĠĠĠĠĠ Ġsubscriptions . add ( sub ) ĊĠĠĠĠĠĠĠ Ġsubscriptions LiveData . value Ġ= Ġsubscriptions ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġepisode List Layout Ġ= ĠEp isode List Layout ( ĊĠĠĠĠĠĠĠ Ġcontext , Ġlifecycle Owner , Ġsubscriptions LiveData , Ġepisode s , Ġcallbacks ) ĊĠĠĠ ĠfindViewById < Frame Layout >( R . id . episode _ list ). addView ( episode List Layout ) ĊĊĠĠĠ Ġpod cast . observe ( lifecycle Owner , ĠObserver Ġ{ ĊĠĠĠĠĠ Ġp Ġ-> Ġrun Ġ{ ĊĠĠĠĠĠĠĠ Ġrefresh ( p ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġfun Ġrefresh ( podcast : ĠPod cast ) Ġ{ ĊĠĠĠ Ġbinding . podcast Ġ= Ġpod cast ĊĠĠĠ Ġbinding . icon Cache Ġ= ĠApp . i . icon Cache ĊĠĠĠ Ġbinding . execute Pending Bindings () ĊĠ Ġ} ĊĊĠ Ġclass ĠEp isode List Layout ( context : ĠContext , Ġlifecycle Owner : ĠLifecycle Owner , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsubscriptions : ĠLive Data < List < Subscription >>, ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġepisode s : ĠLive Data < List < Episode >>, ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcallbacks : ĠCallback s ) ĊĠĠĠ Ġ: ĠBase Episode List Layout ( context , Ġlifecycle Owner , Ġsubscriptions , Ġepisode s , Ġcallbacks ) Ġ{ ĊĠ Ġ} Ċ } Ċ