package Ġcom . github . pre mn irm al . ticker . base Ċ Ċ import Ġandroid . graphics . Color Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . core . content . Context Compat Ċ import Ġcom . github . mike phil . chart ing . charts . Line Chart Ċ import Ġcom . github . mike phil . chart ing . components . X Axis Ċ import Ġcom . github . mike phil . chart ing . components . Y Axis Ċ import Ġcom . github . mike phil . chart ing . data . Line Data Ċ import Ġcom . github . mike phil . chart ing . data . Line DataSet Ċ import Ġcom . github . pre mn irm al . ticker . model . I History Provider . Range Ċ import Ġcom . github . pre mn irm al . ticker . network . data . DataPoint Ċ import Ġcom . github . pre mn irm al . ticker . ui . Date Axis Formatter Ċ import Ġcom . github . pre mn irm al . ticker . ui . Mult iline X Axis Renderer Ċ import Ġcom . github . pre mn irm al . ticker . ui . Text Marker View Ċ import Ġcom . github . pre mn irm al . ticker . ui . Value Axis Formatter Ċ import Ġcom . github . pre mn irm al . ticker widget . R Ċ Ċ abstract Ġclass ĠBase Graph Activity Ġ: ĠBase Activity () Ġ{ ĊĊĠ Ġprotected Ġvar Ġdata Points : ĠList < DataPoint >? Ġ= Ġnull ĊĠ Ġprotected Ġabstract Ġvar Ġrange : ĠRange ĊĊĠ Ġprotected Ġfun Ġsetup Graph View () Ġ{ ĊĠĠĠ Ġval Ġgraph View : ĠLine Chart Ġ= ĠfindViewById ( R . id . graph View ) ĊĠĠĠ Ġgraph View . is Double Tap To Zoom Enabled Ġ= Ġfalse ĊĠĠĠ Ġgraph View . axis Left . set Draw Grid Lines ( false ) ĊĠĠĠ Ġgraph View . axis Left . set Draw Axis Line ( false ) ĊĠĠĠ Ġgraph View . axis Left . isEnabled Ġ= Ġfalse ĊĠĠĠ Ġgraph View . axis Right . set Draw Grid Lines ( false ) ĊĠĠĠ Ġgraph View . axis Right . set Draw Axis Line ( true ) ĊĠĠĠ Ġgraph View . axis Right . isEnabled Ġ= Ġtrue ĊĠĠĠ Ġgraph View . xAxis . set Draw Grid Lines ( false ) ĊĠĠĠ Ġgraph View . set X Axis Renderer ( ĊĠĠĠĠĠĠĠ ĠMult iline X Axis Renderer ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġgraph View . view Port Handler , Ġgraph View . xAxis , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġgraph View . get Transformer ( Y Axis . Axis Dependency . RIGHT ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ) ĊĠĠĠ Ġgraph View . extra Bottom Offset Ġ= Ġresources . get Dimension ( R . dim en . graph _ bottom _ offset ) ĊĠĠĠ Ġgraph View . legend . isEnabled Ġ= Ġfalse ĊĠĠĠ Ġgraph View . description Ġ= Ġnull ĊĠĠĠ Ġgraph View . set No Data TextColor ( Context Compat . getColor ( this , ĠR . color . color _ accent )) ĊĠĠĠ Ġgraph View . set No Data Text ("") ĊĠĠĠ Ġgraph View . marker Ġ= ĠText Marker View ( this ) ĊĠ Ġ} ĊĊĠ Ġprotected Ġfun Ġload Graph ( ticker : ĠString ) Ġ{ ĊĠĠĠ Ġval Ġgraph View : ĠLine Chart Ġ= ĠfindViewById ( R . id . graph View ) ĊĠĠĠ Ġif Ġ( data Points Ġ== Ġnull Ġ|| Ġdata Points !!. isEmpty ()) Ġ{ ĊĠĠĠĠĠ Ġon No Graph Data ( graph View ) ĊĠĠĠĠĠ Ġgraph View . set No Data Text ( getString ( R . string . no _ data )) ĊĠĠĠĠĠ Ġgraph View . invalidate () ĊĠĠĠĠĠ Ġreturn ĊĠĠĠ Ġ} ĊĠĠĠ Ġgraph View . set No Data Text ("") ĊĠĠĠ Ġgraph View . line Data ?. clear Values () ĊĠĠĠ Ġval Ġseries Ġ= ĠLine DataSet ( data Points , Ġticker ) ĊĠĠĠ Ġseries . set Draw Horizontal Highlight Indicator ( false ) ĊĠĠĠ Ġseries . set Draw Values ( false ) ĊĠĠĠ Ġval Ġcolor Accent Ġ= ĠContext Compat . getColor ( this , ĠR . color . color _ accent ) ĊĠĠĠ Ġseries . set Draw Filled ( true ) ĊĠĠĠ Ġseries . color Ġ= Ġcolor Accent ĊĠĠĠ Ġseries . fill Color Ġ= Ġcolor Accent ĊĠĠĠ Ġseries . fill Alpha Ġ= Ġ 1 5 0 ĊĠĠĠ Ġseries . set Draw Circ les ( true ) ĊĠĠĠ Ġseries . mode Ġ= ĠLine DataSet . Mode . C UB IC _ BE ZI ER ĊĠĠĠ Ġseries . cubic Intensity Ġ= Ġ 0 . 0 7 f ĊĠĠĠ Ġseries . lineWidth Ġ= Ġ 2 f ĊĠĠĠ Ġseries . set Draw Circ les ( false ) ĊĠĠĠ Ġseries . high Light Color Ġ= ĠColor . GRAY ĊĠĠĠ Ġval Ġline Data Ġ= ĠLine Data ( series ) ĊĠĠĠ Ġgraph View . data Ġ= Ġline Data ĊĠĠĠ Ġval Ġx Axis : ĠX Axis Ġ= Ġgraph View . xAxis ĊĠĠĠ Ġval Ġy Axis : ĠY Axis Ġ= Ġgraph View . axis Right ĊĠĠĠ Ġx Axis . value Formatter Ġ= ĠDate Axis Formatter () ĊĠĠĠ Ġy Axis . value Formatter Ġ= ĠValue Axis Formatter () ĊĠĠĠ Ġx Axis . position Ġ= ĠX Axis . X Axis Position . BOTTOM ĊĠĠĠ Ġx Axis . text Size Ġ= Ġ 1 0 f ĊĠĠĠ Ġy Axis . text Size Ġ= Ġ 1 0 f ĊĠĠĠ Ġx Axis . textColor Ġ= ĠColor . GRAY ĊĠĠĠ Ġy Axis . textColor Ġ= ĠColor . GRAY ĊĠĠĠ Ġx Axis . setLabel Count ( 5 , Ġtrue ) ĊĠĠĠ Ġy Axis . setLabel Count ( 5 , Ġtrue ) ĊĠĠĠ Ġy Axis . setPosition ( Y Axis . Y Axis Label Position . OUT SIDE _ CH ART ) ĊĠĠĠ Ġx Axis . set Draw Axis Line ( true ) ĊĠĠĠ Ġy Axis . set Draw Axis Line ( true ) ĊĠĠĠ Ġx Axis . set Draw Grid Lines ( false ) ĊĠĠĠ Ġy Axis . set Draw Grid Lines ( false ) ĊĠĠĠ Ġgraph View . invalidate () ĊĠĠĠ Ġon Graph Data Added ( graph View ) ĊĠ Ġ} ĊĊĠ Ġ/** ĊĠĠ Ġ* Ġxml ĠOnClick ĊĠĠ Ġ* Ġ@ param Ġv ĊĠĠ Ġ*/ ĊĠ Ġfun Ġupdate Range ( v : ĠView ) Ġ{ ĊĠĠĠ Ġwhen Ġ( v . id ) Ġ{ ĊĠĠĠĠĠ ĠR . id . two _ week s Ġ-> Ġrange Ġ= ĠRange . TWO _ W EE KS ĊĠĠĠĠĠ ĠR . id . one _ month Ġ-> Ġrange Ġ= ĠRange . ONE _ MONTH ĊĠĠĠĠĠ ĠR . id . three _ month Ġ-> Ġrange Ġ= ĠRange . TH REE _ MONTH ĊĠĠĠĠĠ ĠR . id . one _ year Ġ-> Ġrange Ġ= ĠRange . ONE _ YEAR ĊĠĠĠĠĠ ĠR . id . max Ġ-> Ġrange Ġ= ĠRange . MAX ĊĠĠĠ Ġ} ĊĠĠĠ Ġval Ġparent Ġ= Ġv . parent Ġas ĠViewGroup ĊĠĠĠ Ġ( 0 Ġuntil Ġparent . child Count ). map Ġ{ Ġparent . getChild At ( it ) Ġ} ĊĠĠĠĠĠĠĠ Ġ. forEach Ġ{ Ġit . isEnabled Ġ= Ġit Ġ!= Ġv Ġ} ĊĠĠĠ Ġfetch Graph Data () ĊĠ Ġ} ĊĊĠ Ġprotected Ġabstract Ġfun Ġfetch Graph Data () ĊĊĠ Ġprotected Ġabstract Ġfun Ġon Graph Data Added ( graph View : ĠLine Chart ) ĊĊĠ Ġprotected Ġabstract Ġfun Ġon No Graph Data ( graph View : ĠLine Chart ) Ċ Ċ }