package Ġcom . sc ich art . sc ish ow case . view Models . dashboard Ċ Ċ import Ġandroid . content . Context Ċ import Ġcom . sc ich art . chart ing . model . Axis Collection Ċ import Ġcom . sc ich art . chart ing . model . Render able Series Collection Ċ import Ġcom . sc ich art . chart ing . visual s . axes . Auto Range Ċ import Ġcom . sc ich art . chart ing . visual s . axes . Numeric Axis Ċ import Ġcom . sc ich art . chart ing . visual s . render able Series . Fast Line Render able Series Ċ import Ġcom . sc ich art . core . framework . IS uspend able Ċ import Ġcom . sc ich art . core . framework . Update Sus p ender Ċ import Ġcom . sc ich art . drawing . common . Solid Pen Style Ċ import Ġcom . sc ich art . drawing . utility . Color Util Ċ import Ġcom . sc ich art . sc ish ow case . model . I DataProvider Ċ import Ġcom . sc ich art . sc ish ow case . model . dashboard . Dashboard Data Ċ import Ġcom . sc ich art . sc ish ow case . utils . Xy Data Series Ċ import Ġcom . sc ich art . sc ish ow case . utils . dip Ċ import Ġcom . sc ich art . sc ish ow case . view Models . Fragment ViewModel Base Ċ import Ġcom . trello . rx lifecycle 2 . Lifecycle Provider Ċ import Ġcom . trello . rx lifecycle 2 . kotlin . bind To Lifecycle Ċ Ċ class ĠDashboard ViewModel ( context : ĠContext , Ġprivate Ġval Ġdata Provider : ĠI DataProvider < Dashboard Data >, Ġprivate Ġval Ġsuspend able : ĠIS uspend able ) Ġ: ĠFragment ViewModel Base ( context ) Ġ{ ĊĊĠĠĠ Ġval Ġx Axes : ĠAxis Collection Ġ= ĠAxis Collection () ĊĠĠĠ Ġval Ġy Axes : ĠAxis Collection Ġ= ĠAxis Collection () ĊĠĠĠ Ġval Ġrender able Series : ĠRender able Series Collection Ġ= ĠRender able Series Collection () ĊĊĠĠĠ Ġprivate Ġval Ġdata Series Ġ= ĠX y Data Series < Long , ĠLong >() ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġx Axes . add ( Numeric Axis ( context ). apply Ġ{ Ġauto Range Ġ= ĠAuto Range . Always Ġ}) ĊĠĠĠĠĠĠĠ Ġy Axes . add ( Numeric Axis ( context ). apply Ġ{ Ġauto Range Ġ= ĠAuto Range . Always Ġ}) ĊĊĠĠĠĠĠĠĠ Ġval Ġline Thickness Ġ= Ġcontext . dip ( 1 f ) ĊĊĠĠĠĠĠĠĠ Ġrender able Series . add ( Fast Line Render able Series (). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdata Series Ġ= Ġthis @ Dashboard ViewModel . data Series ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstroke Style Ġ= ĠSolid Pen Style ( Color Util . Grey , Ġtrue , Ġline Thickness , Ġnull ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġsubscribe ( lifecycle Provider : ĠLifecycle Provider <* >) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . subscribe ( lifecycle Provider ) ĊĊĠĠĠĠĠĠĠ Ġdata Provider . getData (). do On Next Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠUpdate Sus p ender . using ( suspend able , Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġdata Series . append ( it . time , Ġit . memory Usage ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠĠĠĠĠ Ġ}. bind To Lifecycle ( lifecycle Provider ). subscribe () ĊĠĠĠ Ġ} Ċ }