package Ġorg . opp ia . android . app . walk through . topic list . topic list view model Ċ Ċ import Ġandroidx . annotation . Color Int Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġorg . opp ia . android . R Ċ import Ġorg . opp ia . android . app . home . topic list . Topic Summary ClickListener Ċ import Ġorg . opp ia . android . app . model . Topic Summary Ċ import Ġorg . opp ia . android . app . translation . App Language Resource Handler Ċ import Ġorg . opp ia . android . app . walk through . topic list . Walk through Topic Item ViewModel Ċ Ċ /** Ġ[ ViewModel ] Ġcorresponding Ġto Ġtopic Ġsummar ies Ġin Ġ[ Walk through Topic List Fragment ] ĠRecyclerView .. Ġ*/ Ċ class ĠWalk through Topic Summary ViewModel ( ĊĠ Ġval Ġtopic EntityType : ĠString , ĊĠ Ġval Ġtopic Summary : ĠTopic Summary , ĊĠ Ġprivate Ġval Ġtopic Summary ClickListener : ĠTopic Summary ClickListener , ĊĠ Ġprivate Ġval Ġresource Handler : ĠApp Language Resource Handler Ċ ) Ġ: ĠWalk through Topic Item ViewModel () Ġ{ ĊĠ Ġval Ġname : ĠString Ġ= Ġtopic Summary . name ĊĊĠ Ġ@ Color Int ĊĠ Ġval ĠbackgroundColor : ĠInt Ġ= Ġretrieve BackgroundColor () ĊĊĠ Ġ/** ĠCallback Ġfrom Ġdata - binding Ġfor Ġwhen Ġthe Ġsummary Ġtile Ġis Ġclicked . Ġ*/ ĊĠ Ġfun Ġclick On Summary Tile () Ġ{ ĊĠĠĠ Ġtopic Summary ClickListener . on Topic Summary Clicked ( topic Summary ) ĊĠ Ġ} ĊĊĠ Ġfun Ġcompute Walk through Lesson Count Text (): ĠString Ġ{ ĊĠĠĠ Ġreturn Ġresource Handler . get Quantity String In Locale With Wr apping ( ĊĠĠĠĠĠ ĠR . plurals . lesson _ count , ĊĠĠĠĠĠ Ġtopic Summary . total Chapter Count , ĊĠĠĠĠĠ Ġtopic Summary . total Chapter Count . toString () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Color Int ĊĠ Ġprivate Ġfun Ġretrieve BackgroundColor (): ĠInt Ġ{ ĊĠĠĠ Ġreturn Ġ( 0 xff 0 0 0 0 0 0 L Ġor Ġtopic Summary . topic Thumbnail . backgroundColor Rgb . to Long ()). toInt () ĊĠ Ġ} Ċ } Ċ