package Ġcom . dv per my ak ov . image post application . application Ċ Ċ import Ġandroid . app . Activity Ċ import Ġandroid . app . Application Ċ import Ġandroid . content . Context Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġandroidx . fragment . app . Fragment Activity Ċ import Ġandroidx . fragment . app . FragmentManager Ċ import Ġandroidx . multi dex . Multi Dex Application Ċ import Ġcom . dv per my ak ov . base . ioc . I En rich able Item Ċ import Ġcom . dv per my ak ov . base . ioc . I Injector Holder Ċ import Ġcom . dv per my ak ov . image post application . Build Config Ċ import Ġcom . dv per my ak ov . image post application . di . components . Application Component Ċ import Ġio . m ichael ro cks . lights aber . Lights aber Ċ import Ġtim ber . log . Tim ber Ċ Ċ /** Ċ Ġ* ĠCreated Ġby Ġd mit ry per my ak ov Ġon Ġ 2 8 / 0 4 / 2 0 1 8 . Ċ Ġ*/ Ċ Ċ class ĠMain Application Ġ: ĠMulti Dex Application (), ĠI Injector Holder Ġ{ ĊĠĠĠ Ġprivate Ġval Ġapp Injector Ġby Ġlazy Ġ{ ĠL ights aber . get (). create Injector ( Application Component ( application Context )) Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate () ĊĠĠĠĠĠĠĠ Ġif Ġ( Build Config . DEBUG ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠTim ber . plant ( Tim ber . Debug Tree ()) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġregister Activity Lifecycle Callbacks ( Activity En rich ing Implementation ( this )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Injector () Ġ= Ġapp Injector Ċ } Ċ Ċ interface ĠActivity Lifecycle Callbacks Ġ: ĠApplication . Activity Lifecycle Callbacks Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġon Activity Created ( activity : ĠActivity ?, Ġbundle : ĠBundle ?) Ġ= ĠUnit ĊĠĠĠ Ġoverride Ġfun Ġon Activity Started ( activity : ĠActivity ?) Ġ= ĠUnit ĊĠĠĠ Ġoverride Ġfun Ġon Activity Res umed ( activity : ĠActivity ?) Ġ= ĠUnit ĊĠĠĠ Ġoverride Ġfun Ġon Activity Paused ( activity : ĠActivity ?) Ġ= ĠUnit ĊĠĠĠ Ġoverride Ġfun Ġon Activity Stopped ( activity : ĠActivity ?) Ġ= ĠUnit ĊĠĠĠ Ġoverride Ġfun Ġon Activity Save InstanceState ( activity : ĠActivity ?, Ġbundle : ĠBundle ?) Ġ= ĠUnit ĊĠĠĠ Ġoverride Ġfun Ġon Activity Destroyed ( activity : ĠActivity ?) Ġ= ĠUnit Ċ } Ċ Ċ class ĠActivity En rich ing Implementation ( private Ġval Ġinjector Holder : ĠI Injector Holder ) Ġ: ĠActivity Lifecycle Callbacks Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġon Activity Created ( activity : ĠActivity ?, Ġbundle : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġ( activity Ġas ? ĠI En rich able Item )?. bind Injector ( injector Holder ) ĊĠĠĠĠĠĠĠ Ġ( activity Ġas ? ĠFragment Activity )?. let Ġ{ Ġfragment Activity Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfragment Activity . support FragmentManager ?. register Fragment Lifecycle Callbacks ( Fragment En rich ing Implementation ( injector Holder ), Ġtrue ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Activity Destroyed ( activity : ĠActivity ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġ( activity Ġas ? ĠI En rich able Item )?. unbind Injector () ĊĠĠĠ Ġ} Ċ } Ċ Ċ class ĠFragment En rich ing Implementation ( private Ġval Ġinjector Holder : ĠI Injector Holder ) Ġ: ĠFragment Manager . Fragment Lifecycle Callbacks () Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġon Fragment Attached ( fm : ĠFragment Manager , Ġfragment : ĠFragment , Ġcontext : ĠContext ) Ġ{ ĊĠĠĠĠĠĠĠ Ġ( fragment Ġas ? ĠI En rich able Item )?. bind Injector ( injector Holder ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Fragment Detached ( fm : ĠFragment Manager , Ġfragment : ĠFragment ) Ġ{ ĊĠĠĠĠĠĠĠ Ġ( fragment Ġas ? ĠI En rich able Item )?. unbind Injector () ĊĠĠĠ Ġ} Ċ }