package Ġcom . str v academy . dr ab ek j . movie app . utils . glide Ċ Ċ import Ġandroid . graphics . drawable . Drawable Ċ import Ġandroid . databinding . Binding Adapter Ċ import Ġandroid . widget . ImageView Ċ import Ġcom . bump tech . glide . load . engine . Disk Cache Strategy Ċ import Ġcom . bump tech . glide . load . resource . drawable . Drawable Transition Options Ċ import Ġcom . bump tech . glide . request . RequestOptions Ċ import Ġcom . str v academy . dr ab ek j . movie app . R ĊĊ Ċ @ Binding Adapter (" imageUrl ") Ċ fun Ġset ImageUrl ( imageView : ĠImageView , Ġurl : ĠString ) Ġ{ Ċ ĉ G lide App Ċĉĉ ĉ . with ( imageView . context ) Ċĉĉ ĉ . load ( url ) Ċĉĉ ĉ . disk Cache Strategy ( Disk Cache Strategy . AUT OM AT IC ) Ċĉĉ ĉ . placeholder ( R . drawable . ic _ image _ black _ placeholder _ 2 4 dp ) Ċĉĉ ĉ . transition ( Drawable Transition Options . with Cross Fade ()) Ċĉĉ ĉ . into ( imageView ) Ċ } ĊĊ Ċ @ Binding Adapter ( value Ġ= Ġ* array Of (" imageUrl ", Ġ" image Placeholder ", Ġ" is Circle "), Ġrequire All Ġ= Ġfalse ) Ċ fun Ġset ImageUrl ( imageView : ĠImageView , Ġurl : ĠString , Ġplaceholder : ĠDrawable ?, Ġis Circle : ĠBoolean ) Ġ{ Ċ ĉ if Ġ( is Circle ) Ġ{ Ċĉ ĉ G lide App Ċĉĉĉ ĉ . with ( imageView . context ) Ċĉĉĉ ĉ . load ( url ) Ċĉĉĉ ĉ . disk Cache Strategy ( Disk Cache Strategy . AUT OM AT IC ) Ċĉĉĉ ĉ . placeholder ( placeholder ) Ċĉĉĉ ĉ . transition ( Drawable Transition Options . with Cross Fade ()) Ċĉĉĉ ĉ . apply ( RequestOptions . circle Crop Transform ()) Ċĉĉĉ ĉ . into ( imageView ) Ċ ĉ } Ġelse Ġ{ Ċĉ ĉ setImage Url ( imageView , Ġurl ) Ċ ĉ } Ċ } ĊĊ Ċ @ Binding Adapter ( value Ġ= Ġ* array Of (" imageUrl ", Ġ" image Placeholder ", Ġ" image Error "), Ġrequire All Ġ= Ġfalse ) Ċ fun Ġset ImageUrl ( imageView : ĠImageView , Ġurl : ĠString , Ġplaceholder : ĠDrawable ?, Ġerror : ĠDrawable ?) Ġ{ Ċ ĉ val Ġrequest Manager Ġ= ĠG lide App . with ( imageView . context ) Ċ ĉ val Ġbuilder Ġ= Ġrequest Manager . load ( url ) Ċ ĉ G lide Utility . setup RequestBuilder ( builder , Ġplaceholder , Ġerror ) ĊĊ ĉ builder . into ( imageView ) Ċ }