package Ġcom . example . bank _ map _ view . mvp . presenter Ċ Ċ import Ġcom . example . bank _ branch _ details . event . RestApi Events Ċ import Ġcom . example . bank _ branch _ details . mvp . model . Branch Model Ċ import Ġcom . example . bank _ branch _ details . mvp . presenter . Base Presenter Ċ import Ġcom . example . bank _ map _ view . mvp . view . Currency View Ċ import Ġcom . example . bank _ map _ view . ui . activities . MainActivity Ċ import Ġorg . green robot . event bus . EventBus Ċ import Ġorg . green robot . event bus . Subscribe Ċ Ċ class ĠCurrency Presenter ( val Ġcurrency View : ĠCurrency View ) Ġ: ĠBase Presenter () Ġ{ ĊĊĠĠĠ Ġoverride Ġfun ĠonStart (){ ĊĠĠĠĠĠĠĠ Ġif (! EventBus . getDefault (). is Registered ( this )){ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). register ( this ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġstart Loading Currency Details (){ ĊĠĠĠĠĠĠĠ Ġcurrency View . show Loading () ĊĠĠĠĠĠĠĠ ĠBranch Model . getInstance (). getC urrency () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Stop (){ ĊĠĠĠĠĠĠĠ Ġif ( EventBus . getDefault (). is Registered ( this )){ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). unregister ( this ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Subscribe ĊĠĠĠ Ġfun ĠonSuccess ( event Ġ: ĠRest Api Events . Show Currency ){ ĊĠĠĠĠĠĠĠ Ġcurrency View . dismiss Loading () ĊĠĠĠĠĠĠĠ Ġcurrency View . show Currency Details ( event . currency Response ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Subscribe ĊĠĠĠ Ġfun ĠonError ( event : ĠRest Api Events . Error Inv oking API Event ){ ĊĠĠĠĠĠĠĠ Ġcurrency View . dismiss Loading () ĊĠĠĠĠĠĠĠ Ġcurrency View . show Prompt ( event . message ) ĊĠĠĠ Ġ} Ċ }