package Ġcom . phil soft . metro trip per . app . ui . helper Ċ Ċ import Ġandroid . content . Context Ċ import Ġcom . google . android . gms . location . Location Services Ċ import Ġcom . phil soft . metro trip per . app . state . Location Ui Event . Initial Location Update Ċ import Ġcom . phil soft . metro trip per . utils . map . Rx Location Ċ import Ġcom . t br uy elle . rx permissions 2 . Rx Permissions Ċ import Ġio . reactivex . Observable Ċ Ċ /** Ċ Ġ* ĠProvides Ġan Ġobservable Ġfor Ġlocation Ġupdate Ġevents . Ġ ĠMust Ġbe Ġinitialized Ġin ĠonCreate Ġof Ġan Ġactivity Ċ Ġ*/ Ċ class ĠLocation Helper ( val Ġcontext : ĠContext , Ġval Ġrx Permissions : ĠRx Permissions ) Ġ{ ĊĊĠĠĠ Ġval Ġlocation Events Ġ= Ġsetup Location Events () ĊĊĠĠĠ Ġprivate Ġfun Ġsetup Location Events (): ĠObservable < Initial Location Update > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġclient Ġ= ĠLocation Services . getF used Location Provider Client ( context ) ĊĠĠĠĠĠĠĠ Ġreturn ĠRx Location . location Events ( client , Ġrx Permissions ). map Ġ{ Ġlocation Result Ġ-> ĠInitial Location Update ( location Result ) Ġ}. share () ĊĠĠĠ Ġ} Ċ } Ċ