package Ġcom . j ota . sun sh ine . presenter Ċ Ċ import Ġcom . j ota . sun sh ine . Constants . DEFAULT _ LAT IT UDE Ċ import Ġcom . j ota . sun sh ine . Constants . DEFAULT _ LONG IT UDE Ċ import Ġcom . j ota . sun sh ine . domain . inter actors . Default Observer Ċ import Ġcom . j ota . sun sh ine . domain . inter actors . Get City Forecast UseCase Ċ import Ġcom . j ota . sun sh ine . domain . model . City Forecast Ċ import Ġcom . j ota . sun sh ine . internal . di . scope . Per Fragment Ċ import Ġcom . j ota . sun sh ine . model . mapper . City Forecast Model Data Mapper Ċ import Ġcom . j ota . sun sh ine . view . views . Forecast View Ċ import Ġjavax . inject . Inject Ċ Ċ @ Per Fragment Ċ class ĠFore cast Presenter Ġ@ Inject Ġconstructor ( ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġget City Forecast UseCase : ĠGet City Forecast UseCase , ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġcity Forecast Model Data Mapper : ĠCity Forecast Model Data Mapper ) Ġ: ĠBase Presenter Ġ{ ĊĊĠĠĠ Ġvar Ġview : ĠFore cast View ? Ġ= Ġnull ĊĊĠĠĠ Ġoverride Ġfun Ġresume () Ġ{ ĊĠĠĠĠĠĠĠ Ġget City Forecast UseCase . execute ( City Forecast Observer (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠGet City Forecast UseCase . Params . for City Weather ( DEFAULT _ LAT IT UDE , ĠDEFAULT _ LONG IT UDE )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġpause () Ġ{ ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġdestroy () Ġ{ ĊĠĠĠĠĠĠĠ Ġget City Forecast UseCase . dispose () ĊĠĠĠĠĠĠĠ Ġview Ġ= Ġnull ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġinner Ġclass ĠCity Forecast Observer Ġ: ĠDefault Observer < City Forecast >() Ġ{ ĊĠĠĠĠĠĠĠ Ġoverride Ġfun ĠonError ( exception : ĠThrowable ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsuper . onError ( exception ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġview ?. error ( exception . message !! ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Next ( city Forecast : ĠCity Forecast ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsuper . onNext ( city Forecast ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġview ?. set City Forecast ( city Forecast Model Data Mapper . transform ( city Forecast )) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }