package Ġcom . effective . android . service . account Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . Intent Ċ import Ġcom . effective . android . base . rx java . Rx Schedulers Ċ import Ġcom . effective . android . service . account . data . Account Repository Ċ import Ġcom . effective . android . service . account . view . Login Activity Ċ import Ġcom . plugin . component . anno . Auto Inject Impl Ċ import Ġio . reactivex . Flow able Ċ import Ġio . reactivex . functions . Consumer ĊĊ Ċ /** Ċ Ġ* ĠEmail Ġy ummy l . la u @ gmail . com Ċ Ġ* ĠCreated Ġby Ġy ummy la u Ġon Ġ 2 0 1 8 / 0 1 / 2 5 . Ċ Ġ*/ Ċ @ Auto Inject Impl ( sdk Ġ= Ġ[ Account Sdk :: class ]) Ċ class ĠAccount ServiceImpl Ġ: ĠAccount Sdk Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġis Login (): ĠFlow able < Boolean > Ġ= ĠAccount Repository . get (). is Login () ĊĊĠĠĠ Ġoverride Ġfun Ġlogout () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= ĠAccount Repository . get (). logout () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. compose ( Rx Schedulers . flow able Io To Main ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe ( Consumer Ġ{ Ġ}) ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġoverride Ġfun Ġlogin ( context : ĠContext ) Ġ{ ĊĠĠĠĠĠĠĠ Ġcontext . startActivity ( Intent ( context , ĠLogin Activity :: class . java )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Account (): ĠFlow able < UserInfo > Ġ= ĠAccount Repository . get (). getUser Info () ĊĊĠĠĠ Ġoverride Ġfun Ġadd Account ChangeListener ( account ChangeListener : ĠAccount ChangeListener ) Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ(! Account Repository . get (). listeners . contains ( account ChangeListener )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠAccount Repository . get (). listeners . add ( account ChangeListener ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġremove Account ChangeListener ( account ChangeListener : ĠAccount ChangeListener ) Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( Account Repository . get (). listeners . contains ( account ChangeListener )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠAccount Repository . get (). listeners . remove ( account ChangeListener ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ