package Ġcom . je trad ar mobile . social login . rx Ċ Ċ import Ġandroid . app . Activity Ċ import Ġcom . je trad ar mobile . social login . Social Account Ċ import Ġcom . je trad ar mobile . social login . Social Auth Callback Ċ import Ġcom . je trad ar mobile . social login . Social Auth Error Ċ import Ġcom . je trad ar mobile . social login . Social Network Ċ import Ġio . reactivex . Comp letable Ċ import Ġio . reactivex . Single Ċ Ċ fun ĠSocial Network . login ( activity : ĠActivity ): ĠSingle < Social Account > Ġ= ĠSingle . create Ġ{ Ġemitter Ġ-> ĊĠ Ġval Ġcallback Ġ= Ġobject Ġ: ĠSocial Auth Callback Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġon Login Success ( social Network : ĠSocial Network , Ġaccount : ĠSocial Account ) Ġ= Ġemitter . on Success ( account ) ĊĠĠĠ Ġoverride Ġfun Ġon Logout Success ( social Network : ĠSocial Network ) Ġ{} ĊĠĠĠ Ġoverride Ġfun Ġon Auth Error ( social Network : ĠSocial Network , Ġerror : ĠSocial Auth Error ) Ġ= Ġemitter . onError ( error ) ĊĠ Ġ} ĊĠ Ġlogin ( activity , Ġcallback ) Ċ } Ċ Ċ fun ĠSocial Network . logout ( activity : ĠActivity ): ĠComp letable Ġ= ĠComp letable . create Ġ{ Ġemitter Ġ-> ĊĠ Ġval Ġcallback Ġ= Ġobject Ġ: ĠSocial Auth Callback Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġon Login Success ( social Network : ĠSocial Network , Ġaccount : ĠSocial Account ) Ġ{} ĊĠĠĠ Ġoverride Ġfun Ġon Logout Success ( social Network : ĠSocial Network ) Ġ= Ġemitter . onComplete () ĊĠĠĠ Ġoverride Ġfun Ġon Auth Error ( social Network : ĠSocial Network , Ġerror : ĠSocial Auth Error ) Ġ= Ġemitter . onError ( error ) ĊĠ Ġ} ĊĠ Ġlogout ( activity , Ġcallback ) Ċ } Ċ