package Ġcom . dag an . li or . crypto _ currency _ market _ price . bitcoin pr ic em ain screen . presenter Ċ Ċ import Ġcom . dag an . li or . crypto _ currency _ market _ price . bitcoin pr ic em ain screen . model . Crypto Price Interactor Ċ import Ġcom . dag an . li or . crypto _ currency _ market _ price . bitcoin pr ic em ain screen . model . Firebase Interactor Ċ import Ġcom . dag an . li or . crypto _ currency _ market _ price . bitcoin pr ic em ain screen . view . Crypto Price View Ċ Ċ class ĠCrypto Price Presenter ( private Ġvar Ġcrypto Price View : ĠCrypto Price View ?, ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġprivate Ġval Ġcrypto Price Inter acter : ĠCrypto Price Interactor , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġprivate Ġval Ġfirebase Interactor : ĠFirebase Interactor ) ĊĠĠĠ Ġ: ĠCrypto Price Interactor . On Finish Listener , ĊĠĠĠ ĠFirebase Interactor . On Finish Listener { ĊĊĠĠĠ Ġprivate Ġvar Ġlast Price : ĠDouble ? Ġ= Ġnull ĊĊĠĠĠ Ġfun Ġget Price Data () Ġ{ ĊĠĠĠĠĠĠĠ Ġcrypto Price View ?. set Price ( 0 . 0 ) ĊĠĠĠĠĠĠĠ Ġcrypto Price View ?. show Price Progress () ĊĠĠĠĠĠĠĠ Ġcrypto Price Inter acter . request Crypto Price Data From API ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Chart Data () Ġ{ ĊĠĠĠĠĠĠĠ Ġcrypto Price View ?. show Chart Progress () ĊĠĠĠĠĠĠĠ Ġval Ġnum Week s Ġ= Ġcrypto Price View ?. get Seek Bar Progress () ĊĠĠĠĠĠĠĠ Ġcrypto Price View ?. display Time span ( when Ġ( num Week s ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠ 0 , 1 0 Ġ-> Ġ" All ĠTime " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġelse Ġ-> Ġnum Week s . toString () Ġ+ Ġ" Ġweek Ġoverview " ĊĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠĠĠĠĠ Ġcrypto Price Inter acter . request Crypto Chart Data From API ( this , Ġnum Week s !! ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Previous Price () Ġ{ ĊĠĠĠĠĠĠĠ Ġcrypto Price View ?. set Previous Price ("") ĊĠĠĠĠĠĠĠ Ġcrypto Price View ?. show Chart Progress () ĊĠĠĠĠĠĠĠ Ġfirebase Interactor . request Previous Price View ed ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Chart Result Success ( chart Data : ĠMutable List < Pair < Long , ĠDouble >>) Ġ{ ĊĠĠĠĠĠĠĠ Ġcrypto Price View ?. hide Chart Progress () ĊĠĠĠĠĠĠĠ Ġcrypto Price View ?. set Chart ( chart Data ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Price Result Success ( price : ĠDouble ) Ġ{ ĊĠĠĠĠĠĠĠ Ġcrypto Price View ?. hide Price Progress () ĊĠĠĠĠĠĠĠ Ġlast Price Ġ= Ġprice ĊĠĠĠĠĠĠĠ Ġcrypto Price View ?. set Price ( price ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Result Failed ( error : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġcrypto Price View ?. hide Price Progress () ĊĠĠĠĠĠĠĠ Ġcrypto Price View ?. hide Chart Progress () ĊĠĠĠĠĠĠĠ Ġcrypto Price View ?. display Error ( error ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Previous Price Request Success ( price : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġcrypto Price View ?. hide Previous Price Progress () ĊĠĠĠĠĠĠĠ Ġcrypto Price View ?. set Previous Price ( price ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Previous Price Request Failed ( error : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġcrypto Price View ?. hide Previous Price Progress () ĊĠĠĠĠĠĠĠ Ġcrypto Price View ?. set Previous Price (" no Ġprevious Ġinformation ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġon Stop () Ġ{ ĊĠĠĠĠĠĠĠ Ġlast Price ?. let Ġ{ Ġprice Ġ-> Ġfirebase Interactor . set Previous Price ( price ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġon Destroy () Ġ{ ĊĠĠĠĠĠĠĠ Ġcrypto Price View Ġ= Ġnull ĊĠĠĠ Ġ} Ċ }