package Ġru . ust im ov . weather . ui . forecast Ċ Ċ import Ġandroid . location . Location Ċ import Ġcom . are l lo mobile . mvp . Inject ViewState Ċ import Ġio . reactivex . Flow able Ċ import Ġru . ust im ov . weather . AppState Ċ Ċ @ Inject ViewState Ċ class ĠCity Location Presenter ( app State : ĠApp State , Ġprivate Ġval Ġcity Id : ĠLong ) Ġ: ĠLocation Presenter ( app State ) Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġon First View Attach () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on First View Attach () ĊĊĠĠĠĠĠĠĠ Ġquery City ById ( city Id ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. do OnError ({ Ġview State . on Location NotFound () Ġ}) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. onError Resume Next ( Flow able . empty ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe ({ Ġview State . on Location Found ( it ) Ġ}) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Location Changed ( location : ĠLocation ) Ġ{ ĊĠĠĠĠĠĠĠ Ġthrow ĠIllegalStateException (" Presenter Ġdoes Ġnot Ġsupport Ġlocation Ġchanges ") ĊĠĠĠ Ġ} Ċ Ċ }