package Ġcom . y ash ov ard han 9 9 . core . utils Ċ Ċ import Ġandroid . text . format . Date Utils Ċ import Ġandroid . view . View Ċ import Ġandroid . widget . ImageView Ċ import Ġandroid . widget . TextView Ċ import Ġandroidx . annotation . Drawable Res Ċ import Ġandroidx . annotation . String Res Ċ import Ġandroidx . databinding . Binding Adapter Ċ import Ġcom . y ash ov ard han 9 9 . core . R Ċ import Ġjava . math . BigDecimal Ċ import Ġjava . text . NumberFormat Ċ import Ġjava . util .* Ċ Ċ @ Binding Adapter (" amount Text ") Ċ fun Ġset Amount Text ( view : ĠTextView , Ġamount : ĠLong ) Ġ{ ĊĠĠĠ Ġval Ġamt In Decimal Ġ= ĠBigDecimal ( amount ). move Point Left ( 2 ) ĊĠĠĠ Ġview . text Ġ= ĠNumber Format . getC urrency Instance (). format ( amt In Decimal ) Ċ } Ċ Ċ @ Binding Adapter (" date ") Ċ fun Ġset Formatted Date ( view : ĠTextView , Ġdate : ĠDate ) Ġ{ ĊĠĠĠ Ġview . text Ġ= ĠDate Utils . get Relative TimeSpan String ( date . time , ĠDate (). time , ĠDate Utils . MINUTE _ IN _ M ILL IS ) Ċ } Ċ Ċ @ Binding Adapter (" he al ings Today ") Ċ fun Ġset He al ings Today ( view : ĠTextView , Ġhe al ings : ĠInt ) Ġ{ ĊĠĠĠ Ġval Ġtoday Ġ= Ġview . context . resources . getString ( R . string . today ) ĊĠĠĠ Ġview . text Ġ= Ġview . context . resources . get Quantity String ( R . plurals . he aling , Ġhe al ings , Ġhe al ings , Ġtoday ) Ċ } Ċ Ċ @ Binding Adapter (" he al ings This Month ") Ċ fun Ġset He al ings This Month ( view : ĠTextView , Ġhe al ings : ĠInt ) Ġ{ ĊĠĠĠ Ġview . text Ġ= Ġview . context . resources . getString ( R . string . number _ this _ month _ text , Ġhe al ings ) Ċ } Ċ Ċ @ Binding Adapter (" android : src ") Ċ fun Ġset Image Resource ( imageView : ĠImageView , Ġ@ Drawable Res Ġresource : ĠInt ) Ġ{ ĊĠĠĠ ĠimageView . setImage Resource ( resource ) Ċ } Ċ Ċ @ Binding Adapter (" android : content Description ") Ċ fun Ġset Content Description Res ( view : ĠView , Ġ@ String Res Ġresource : ĠInt ?) Ġ{ ĊĠĠĠ Ġview . content Description Ġ= Ġresource ?. let Ġ{ Ġview . resources . getString ( it ) Ġ} Ċ }